Created
September 14, 2018 13:50
-
-
Save zhangxiaoda007/1d7b261143a102b7ccbfcaeb34f69f59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# author:The Machinist time:18-9-14 | |
# 猜年龄 | |
age_of_zhang = 26 | |
count = 0 | |
while True: # while count < 3 | |
if count == 3: | |
break | |
guess_age = int(input("guess age:")) | |
if guess_age == age_of_zhang: | |
print("yes,you got it.") | |
break | |
elif guess_age > age_of_zhang: | |
print("think smaller...") | |
else: | |
print("think bigger!") | |
count = count + 1 # count +=1 | |
if count == 3: | |
print("you have tried too many times..fuck off!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment