标题 用Python设计第一个游戏
根据视频自己练习 :
直接上源码了
print(’------------------我爱Python------------------’)
tmp = input("test the input, you can input anything you want ")
print(tmp)
temp = input(“不妨猜一下小次郎现在心里想的是哪个数字:”)
guess = int(temp)
if guess == 8:
print(“我晕,你有特异功能吗?!”)
print(“不过 猜中了也没有奖励!”)
else:
print(“猜错拉,现在心里想的是8!”)
print(“游戏结束,不玩啦_”)
运行结果
------------------我爱Python------------------
test the input, you can input anything you want 12
12
不妨猜一下小次郎现在心里想的是哪个数字:8
我晕,你有特异功能吗?!
不过 猜中了也没有奖励!
游戏结束,不玩啦_