python3基础5-用户输入和while循环

#coding:utf-8
#允许汉语注释
#输入和while循环
message = input("tell me sth:")
print(message)
#字符串转换成int
height = int(message)
print(height)
while height!=5:
    t=input("guess: ")
    print(t)
    height = int(t)
print("ok")

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>