限时猜年龄

#
#
# Readme:
# Guess age.You have 10 second to guess.
# Blog Addr:
# http://www.cnblogs.com/dennnnnis/
#    http://www.xd.com/games/play?app=sxd&server=s2334
# program summary:
# Guess age.You have 10 second to guess.
#
# Author: Dennis Huang


import time

ture_age = 33
tm_length = 0
start_tm = int(time.time())
while tm_length < 10 :
tm_length = int(time.time()) - start_tm
age = int(input("Guess myage:"))
if age == 33:
print("You win!")
break
elif age < ture_age:
print("Too young.")
else:
print("Too old.")
else:
print("Time out")
原文地址:https://www.cnblogs.com/dennnnnis/p/6876898.html