正如你所看到的,我是編程中的新手,並且使用Python開始,上述錯誤發生在突出顯示的代碼行上。 如何駕馭此...Python錯誤:Unindent不匹配任何外部Uindentation限制
import random
secret= random.randint (1,100)
guess=0
tries=0
print "AHOY! I am the dead pirate Roberts, and I ahve a secret!"
print "It is a number from 1 to 99. I will give you six tries."
while guess !=secret and tries <6:
guess= input("what's yer guess? ")
if guess < secret :
print "Too Low, ye curvy dog!"
elif guess > secret:
print "Too high, landlubber!"
tries= tries +1
***if guess == secret :***
print "Avast! Ye got it! found my secret, ye did!"
else:
print "No more guesses! Better luck next time, matey!"
print "The secret number was ", secret"
非常感謝,感激...... – 2011-06-06 09:33:43