吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2712|回复: 12
收起左侧

[Python 转载] python小白 猜生肖及验证小游戏

[复制链接]
akon007 发表于 2020-3-10 10:46
本帖最后由 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:")
生肖 = [rat,ox,tiger,rabbit,dragon,snake,horse,sheep,monkey,chicken,dog,pig]
a = 0
b = 0
c = 0
d = 0
print("对应片下方''或者''")
A = [rat,tiger,dragon,horse,monkey,dog]
print(A)
X = input("有?:-")
if X =="":
    a = 0
if X =="":
    a = 1

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

D = [sheep,monkey,chicken,dog,pig]
print(D)
V = input("有?:-")
if V =="":
    d = 0
if V =="":
    d = 8
print("的生肖是:",生肖[a+b+c+d-1])

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

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

image.png
捕获.JPG

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

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

谢谢肯定和支持
leasae 发表于 2020-3-10 10:55
真的不错哦
dxxiong 发表于 2020-3-10 11:07
真的、真的不错
Bashqut 发表于 2020-3-10 11:12
不错不错
yuexiaozi666 发表于 2020-3-10 11:36
看样子不错,感谢楼主
17771425895 发表于 2020-3-10 11:46
这个逻辑思路可以啊  牛逼
vagrantear 发表于 2020-3-10 11:53
这些emoji还挺好玩的,去试试hh
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-26 08:23

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表