これは私のコードですが、タイトルは私が壊れていないと言っています。Pythonはしばらく時間を掛けません。True
from random import randint
import sys
value = int(randint(1,10))
lives = int(5)
userinp = int(0)
if lives == 0:
print("no lives :(")
while True:
if lives != 0:
print(value)
print("You currently have: ", lives, " lives left")
userinp = input("Please enter a number from 1 to 10: ")
if int(userinp) == int(value):
print("Well done you wn :D")
sys.exit()
elif int(userinp) > int(value):
print("Your guess was too high please guess again")
lives = lives - 1
elif int(userinp) < int(value):
print("Your guess was too low please guess again")
lives = lives - 1
if lives == 0:
print("this")
*は*あなたの '休憩 'ですか? – elslooo
'lives = int(5); userinp = int(0) 'なぜですか? – DeepSpace
'while True'は無限ループで、すべてのCPUサイクルの100%を消費し、決して中断しません。なぜなら' while 'は条件が' False'になると終了しますが、本当! –