请问python字符不能这样比较吗?
t = "quit"
while True:
s = input('input a number:')
if s == t:
break
else:
print('Length of the string is',len(s))
else:
print('Done')
python 3.0字符串比较问题
最新推荐文章于 2021-03-25 19:54:16 发布
本文提供了一个Python脚本示例,展示了如何使用字符串进行条件判断。通过输入一个字符串并与预定义的退出字符串进行比较来控制循环的结束,同时演示了如何计算并输出输入字符串的长度。
2992

被折叠的 条评论
为什么被折叠?



