所以我正在写一个比赛的游戏。麻烦在Python中分割和分割
直到此时,用户输入了一个数字。
if user % 2 == 0 :
print("What you entered is an even number.")
print("")
print("So, according to RULE 1, we must now divide it by 2.")
int(user)/ 2
thing2 = "So, now we're left with " + str(user) + "."
print (thing2)
else :
print("What you entered is an odd number.")
print("")
print("So, according to RULE 1, we must now multiply it by 3, and add 1.")
int(user) * 3
user += 1
thing2 = "So, now we're left with " + str(user) + "."
print (thing2)
....但int(user) * 3
部分实际上并不乘以3号,但它确实增加了一个。
为了记录,我尝试了很多可能性,例如只有user * 3
(没有int()的东西),我是Python的初学者。
谢谢,对不起,这是一个愚蠢的错误。 – gingepusscat123