1 Star 2 Fork 2

刘彬彬/小知识_自动化任务脚本_DhanushNehru

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
jokes.py 663 Bytes
一键复制 编辑 原始数据 按行查看 历史
Aashit Agrawal 提交于 2年前 . folder name change
import pyjokes
def cat(op):
if op == 1:
return "neutral"
if op == 2:
return "chuck"
if op == 3:
return "twister"
if op == 4:
return "all"
def lan(op):
if op == 3:
return "de"
elif 1<=op<=2 or op == 4:
return "en"
option = 0
print("MENU\n1. Neutral\n2. Chuck Norris jokes\n3. Twisters(in gerrman)\n4. All\n5. Exit.")
while option != 5:
try:
option = int(input("enter option: "))
My_joke = pyjokes.get_joke(language= lan(option), category= cat(option))
print(My_joke)
except pyjokes.pyjokes.LanguageNotFoundError:
print("successfully exited!")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/liu_binbin/some_python_scripts.git
git@gitee.com:liu_binbin/some_python_scripts.git
liu_binbin
some_python_scripts
小知识_自动化任务脚本_DhanushNehru
master

搜索帮助