#抽签测运势
import random
print("Let's test your today luck!")
lot=random.randint(1,4)
if lot==1:
#上上签
print("the best lot!!","\n\nwow!You're the most lucky people who I have seen!!!")
elif lot==2:
#上签
print("better lot!","\n\nFantastic!")
elif lot==3:
#中签
print("so-so lot","\n\nnot bad~")
elif lot==4:
#下签
print("a little bad","\n\nDon't worry!It represents just now!")
else:
print("??")
input("\n\nPress the enter key to exit.")
求大佬救救自学的可怜孩子5555
import random
print("Let's test your today luck!")
lot = random.randint(1, 4)
print(f"Today You've number {lot}")
if lot == 1:
#上上签
print("the best lot!!", "\n\nwow!You're the most lucky people who I have seen!!!")
elif lot == 2:
#上签
print("better lot!", "\n\nFantastic!")
elif lot == 3:
#中签
print("so-so lot", "\n\nnot bad~")
elif lot == 4:
#下签
print("a little bad", "\n\nDon't worry!It represents just now!")
else:
print("??")
input("\n\nPress the enter key to exit.")
你的代码缩进有问题。复制这段代码就可运行了
如果用pycharm应该会报错,缩进