次のコードでエラーが発生し、何が問題なのかわかりません。
私はこれを行う方法を学ぼうとしているだけで、これはテストでした。
何が間違っているのか、それを修正する方法がわかりません。
print "Would you like to see today's weather?"
answer = input
if answer = "yes":
print "Follow Link: http://www.weather.com/weather/right-now/Yorktown+VA+23693 "
elif answer = "no":
print "Very well, would you like to play a guessing game?"
if answer = "yes":
import random
secret = random.randint (1, 99)
guess= 0
tries= 0
print "AHOY! I'm the Dread Pirate Roberts, and I have a secret!"
print "It is a number from 1 to 99. I'll give you 6 tries. "
while guess != secret and tries < 6:
guess = input("What's your guess? ")
if guess < secret:
print "Too low, ye scurvy dog!"
elif guess > secret:
print "Too high, landlubber!"
tries = tries + 1
if guess == secret:
print "Avast! Ye got it! Found my secret ye did!"
elif answer = "no":
print "Thank you, and goodnight."