python3
import random
the_number = random.randint(1, 100)
guess = int(input("Guess a number between 1 and 100: "))
while guess != the_number:
if guess > the_number:
print(guess, "was too high. Try again.")
if guess < the_number:
print(guess, "was too low. Try again.")
guess = int(input("Guess again: "))
print(guess, "was the number! You win!")
the_number = random.randint(1, 100)
guess = int(input("Guess a number between 1 and 100: "))
while guess != the_number:
if guess > the_number:
print(guess, "was too high. Try again.")
if guess < the_number:
print(guess, "was too low. Try again.")
guess = int(input("Guess again: "))
print(guess, "was the number! You win!")
Last one:python4
Next one:爬楼梯中的人生
声明:以上文章均为用户自行添加,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。
Hot degree:☆☆☆☆☆
Difficulty:☆☆☆☆☆
quality:☆☆☆☆☆
Description: the system according to the heat, the difficulty, the quality of automatic certification, the certification of the article will be involved in typing!
This paper typing ranking TOP20
登录后可见