akon007 发表于 2020-3-10 10:46

python小白 猜生肖及验证小游戏

本帖最后由 akon007 于 2020-3-10 13:13 编辑

from emoji import emojize
rat = emojize(":mouse:")
ox = emojize(":cow:")
tiger = emojize(":tiger:")
rabbit = emojize(":rabbit:")
dragon = emojize(":dragon:")
snake = emojize(":snake:")
horse = emojize(":horse:")
sheep = emojize(":goat:")
monkey = emojize(":monkey:")
chicken = emojize(":chicken:")
dog = emojize(":dog:")
pig = emojize(":pig:")
生肖 = ,ox,tiger,rabbit,dragon,snake,horse,sheep,monkey,chicken,dog,pig]
a = 0
b = 0
c = 0
d = 0
print("请在对应的图片下方输入'有'或者'没有'")
A = ,tiger,dragon,horse,monkey,dog]
print(A)
X = input("有没有?:-")
if X =="没有":
    a = 0
if X =="有":
    a = 1

B = ,tiger,snake,horse,chicken,dog]
print(B)
Y = input("有没有?:-")
if Y =="没有":
    b = 0
if Y =="有":
    b = 2
C = ,dragon,snake,horse,pig]
print(C)
Z = input("有没有?:-")
if Z =="没有":
    c = 0
if Z =="有":
    c = 4

D = ,monkey,chicken,dog,pig]
print(D)
V = input("有没有?:-")
if V =="没有":
    d = 0
if V =="有":
    d = 8
print("您的生肖是:",生肖1])

print("---- 是否检验一下------")
u = 0
yob = int(input("请输入您的出生年份:"))
chinese_zodiac =,chicken,dog,pig,rat,ox,tiger,rabbit,dragon,snake,horse,sheep]
u = yob%12
print("您的生肖是:",chinese_zodiac(u))

################# 输出结果################

haichao 发表于 2020-3-10 15:43

如何导入emoji???????
RESTART: C:/Users/Administrator/AppData/Local/Programs/Python/Python36-32/mypy01/生肖测试.py
Traceback (most recent call last):
File "C:/Users/Administrator/AppData/Local/Programs/Python/Python36-32/mypy01/生肖测试.py", line 1, in <module>
    from emoji import emojize
ModuleNotFoundError: No module named 'emoji'
>>>
RESTART: C:/Users/Administrator/AppData/Local/Programs/Python/Python36-32/mypy01/生肖测试.py
Traceback (most recent call last):
File "C:/Users/Administrator/AppData/Local/Programs/Python/Python36-32/mypy01/生肖测试.py", line 1, in <module>
    from emoji import emojize
ModuleNotFoundError: No module named 'emoji'

akon007 发表于 2020-3-10 20:36

haichao 发表于 2020-3-10 15:45
刚开始学,很小白哈

需要先安装emoji 具体安装以pycharm 为例
file -----> setting ----->project interpreter ----->右边的+号-----》输入emoji -----》install package

ee789852 发表于 2020-3-10 10:51

不错啊,这思路

akon007 发表于 2020-3-10 10:52

ee789852 发表于 2020-3-10 10:51
不错啊,这思路

谢谢肯定和支持:handshake

leasae 发表于 2020-3-10 10:55

真的不错哦

dxxiong 发表于 2020-3-10 11:07

真的、真的不错

Bashqut 发表于 2020-3-10 11:12

不错不错{:1_893:}

yuexiaozi666 发表于 2020-3-10 11:36

看样子不错,感谢楼主

17771425895 发表于 2020-3-10 11:46

这个逻辑思路可以啊牛逼

vagrantear 发表于 2020-3-10 11:53

这些emoji还挺好玩的,去试试hh
页: [1] 2
查看完整版本: python小白 猜生肖及验证小游戏