猫史档案馆


【Python作品分享】S喵【作品秀】

用户:鱼肉粥鱼肉粥查看:0 回复:0 评论:0 创建时间:2022-06-18T17:07:57


【作品展示】

center_image

 

【作品介绍】

S喵系统

 

【作品源代码】

lm = ['1.turn up information', '2.delete information', '3. + information', '4.change information', '5.break']
# 菜单主功能

ls = [[10000000, '096', '12 age', 'man', '1', 'Keter'],
      [11111111, '169', '12 age', 'man', '2', 'Euclid'],
      [22222222, '666', '12 age', 'man', '3', 'Safe']]


# 现有学生列表 the student number , name , age , 喵 , class , information












# S喵 _*_____________________________*_ killer
def up():
    o = []
    a1 = int(input('ID:'))
    a2 = input('name:')
    a3 = input('age:')
    a4 = input('喵:')
    a5 = input('class:')
    a6 = input('information:')
    o.append(a1)
    o.append(a2)
    o.append(a3)
    o.append(a4)
    o.append(a5)
    o.append(a6)
    ls.append(o)
# 显示菜单


def bl():
    print(' - - -The S喵- - -               ')
    print('--------------------')
    for i in lm:
        print(i)
    print('--------------------')


















# 显示收容物信息
def bl2():
    print('''    Id   || name  || age  || 喵||class||category
    ↓        ↓        ↓       ↓     ↓      ↓''')
    for c in ls:
        print(c)
























# back
def back():
    k = input('point y/Y to back: ')
    if k == 'y' or k == 'Y':
        bl()
    else :
        print('MISTAKE?')
        back()



























#添加
def tj():
    try:
        ar = int(input('ID:'))
    except TypeError:
        print('string be not')
        tj()
    else:
        if len(str(ar)) != 8:
            print(' len be not 8!')
            tj()
        for i in ls:
            if ar in i:
                print('had')

                tj()
                break
        else:
            k1 = input('name:')
            k2 = input('age:')
            k3 = input('喵:')
            k4 = input('class:')
            k5 = input('information:')
            m = []
            m.append([ar,k1,k2,k3,k4,k5])
            ls.append(m)
            print('rrriiiggghhhttt!!!')
            print('++++++++____________++++++++')
            return





















#delete
def dt():
    try:
        ar = int(input('ID:'))
    except TypeError:
        print('string be not')
        dt()
    else:
        if len(str(ar)) != 8:
            print(' len be not 8!')
            dt()
        for i in ls:
            if ar in i:
                ls.remove(i)
                break

        else:
            print('hhh')
            dt()

#changing


def xg():
    try:
        ar = int(input('ID:'))
    except TypeError:
        print('string be not')
        xg()
    else:
        if len(str(ar)) != 8:
            print(' len be not 8!')
            xg()
        for i in ls:
            if ar in i:

                c=input('the changing : 1:name , 2:age , 3:喵 , 4:class , 5:information')
                if c == '1':
                    o1 = input('name:')
                    i[1]=o1
                    break
                elif c == '2':
                    o2 = input('age:')
                    i[2]==o2
                    break
                elif c == '3':
                    o3 = input('喵:')
                    i[3] == o3
                    break
                elif c == '4':
                    o4 = input('class:')
                    i[4] == o4
                    break

                if c == '5':
                    o5 = input('information:')
                    i[5]==o5
                    break
                else:
                    print('>?<')
                
                print('OK')
                return
        else:
            xg()






#use
bl()
while True:
    try:
        v = int(input('choose your chooseing:'))

    except TypeError:
        print('Waiting! You had a MISTAKE! Don try to use string.Please input it again!')
        bl()
    except BaseException as n:
        bl()
        print(n)
    else:
        if v < 1 or v > 5:
            print('Do not be silly!')
            bl()
        elif v == 1:
            bl2()
            back()
        elif v == 2:
            dt()

            back()
        elif v == 3:
            tj()
            back()
        elif v == 4:
            xg()
            back()
        else:
            print('Please give some change!')
            break

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页