python又出错的一天
temp = input("请输入一个整数:")guess = int(temp)
jiazai = 0
while guess:
print(jiazai = jiazai + 1)
guess = guess - 1
temp = input("请输入一个整数:")
guess = int(temp)
jiazai = 0
while guess:
print(jiazai = jiazai + 1)这里出错了
guess = guess - 1
C写多了?print(jiazai = jiazai + 1)这段什么意思? wanglingb 发表于 2020-4-14 16:40
怎么出错了? 永恒的蓝色梦想 发表于 2020-4-14 16:44
C写多了?这段什么意思?
输出这个东西呀 你的意思应该是先jiazai+1,再打印jiazai吧。应该写成这样:temp = input("请输入一个整数:")
guess = int(temp)
jiazai = 0
while guess:
jiazai = jiazai + 1
print(jiazai)
guess = guess - 1
先赋值,再打印
temp = input("请输入一个整数:")
guess = int(temp)
jiazai = 0
while guess:
jiazai = jiazai + 1
print(jiazai)
guess = guess - 1 zltzlt 发表于 2020-4-14 17:47
先赋值,再打印
不能输出一个算式? danianyu 发表于 2020-4-15 07:07
不能输出一个算式?
可以呀
print('jiazai = jiazai + 1')
页:
[1]