Python 3.x 我想做一个数学天才的游戏,但我无法让它工作
这段代码哪里出错了?您需要修改最后两条语句,如下所示:Python 3.x 我想做一个数学天才的游戏,但我无法让它工作,python-3.x,Python 3.x,这段代码哪里出错了?您需要修改最后两条语句,如下所示: import random from time import sleep import math print('Hello! What is your name?') myName = input() print('Welcome to the math wiz game!') print('Lets start with the easy stuff!') print('what is 2*4?') if input == 8:
import random
from time import sleep
import math
print('Hello! What is your name?')
myName = input()
print('Welcome to the math wiz game!')
print('Lets start with the easy stuff!')
print('what is 2*4?')
if input == 8:
print('Your right!')
不需要进口。 这是正确的版本
ans1 = int(input('What is 2*4?\n'))
if ans1 == 8:
print("You're right!")
else:
print("Sorry")
嗨,凯,欢迎来到StackOverflow。请参阅问题发布指南,并相应更新您的问题。谢谢
print('Hello! What is your name?')
myName = input()
print('Welcome to the math wiz game!')
print('Lets start with the easy stuff!')
print('what is 2*4?')
NewVariable = input()
if a == 8:
print("Your right!")
else:
print("You don't even know this!")