猫史档案馆


【Python作品分享】among us【求助帖】

用户:BM64编码弟bmdBM64编码弟bmd查看:3 回复:5 评论:3 创建时间:2022-06-23T12:15:33


【作品展示】

center_image

 

【作品介绍】

一个简单的人物档案,持续更新

求助!!!:需要各种among us身份、任务、人物宠物

 

【作品源代码】

import random
class Person():
    person_index=random.randint(0,1)
    person="no"
    if person_index==0:
        person="船员"
    elif person_index==1:
        person="内鬼"
    def __init__(self,name,age):
        self.name=name
        self.age=age
    def died(self,name,id=person):
        di=random.randint(0,1)
        if di==0:
            print(name+"被票出,他是"+id)
        elif di==1:
            print(name+"被杀!!!,他是"+id)
    def task(self, name):
        ti=random.randint(0,3)
        tl=["刷卡","接电线","传输文件","倒垃圾"]
        at=tl[ti]
        print(name+"正在"+at)
red=Person("小红","10岁")
behave = random.randint(0, 1)
print(red)
print(red.name)
print(red.age)
if behave==0:
    red.died(red.name)
elif behave==1:
    red.task(red.name)

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
rph_creatorrph_creator

警长,杀坏人,杀错自己死

点赞1


评论


rph_creatorrph_creator

医生,给盾,盾:免死一次。

点赞1


评论


rph_creatorrph_creator

我是au老粉,很多au的up我都关注了。(名游社 叨叨 ......)

点赞1


评论


BM64编码弟bmdBM64编码弟bmd

新版马上发布!!!

点赞0


评论


BM64编码弟bmdBM64编码弟bmd

imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E6%97%A9%E5%91%80.gif"alt="emotion_编程猫_早呀"

点赞0


评论