所以我在這個項目擁有先進的,我有以下代碼Python的隨機數字猜謎遊戲
import random
number = random.randint(1,100)
name = input('Hi, Whats your name?')
print ("Well", name, "i am thinking of a number between 1 and 100, take a guess")
guess1 = input()
if guess1 == number:
print ("Good job, you got it!")
while guess1 != number:
if guess1 > number:
print ('your guess is too high')
if guess1 < number:
print ('your guess is too low')
它throwns是>或無法海峽之間使用<和int
錯誤怎麼會有我替換符號,以便劑量觸發該錯誤?
您所要求的分配的核心。你有什麼嘗試,你失敗了? – Uriel
作爲註釋,您最好在輸入內包含輸入文本:'myName = input('Hello!你叫什麼名字?')'以防止print print語句後面的換行符。 – Uriel