填写缩写函数中的空白,以便它返回收到的短语中包含的单词的缩写(大写)
#原始代码
def initials(phrase):
words = phrase.___
result = ""
for word in words:
result += ___
return ___
print(initials("Universal Serial Bus")) # Should be: USB
print(initials("local area network")) # Should be: LAN
print(initials("Operating system")) # Should be: OS
#original code
def initials(phrase):
words = phrase.___
result = ""
for word in words:
result += ___
return ___
print(initials("Universal Serial Bus")) # Should be: USB
print(initials("local area network")) # Should be: LAN
print(initials("Operating system")) # Should be: OS
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
下次请把你遇到的一些代码和遇到的问题贴出来。
Please next time put some of your code that you are struggling with and problems you encountered.