【发布时间】:2016-04-28 17:13:12
【问题描述】:
words = input("Enter a word to find its length: ")
for x in words:
print x, len(x)
我希望这段代码在运行时用于用户输入,以便用户输入可以存储在 word 中,并且可以在运行时的 for 循环中使用。
应该怎么做?
【问题讨论】:
-
它不是按原样工作吗?
-
我相信他希望用户能够输入多个单词
-
list = [None]*3 x = True z = 0 while z
标签: python list loops for-loop input