zoukankan      html  css  js  c++  java
  • 作业题练习

    一.随机验证码
    def check_code(): import random
    checkcode = ''
    for i in range(4):
    current = random.randrange(0,4)
    if current != i:
    temp = chr(random.randint(65,90))
    else:
    temp = random.randint(0,9)
    checkcode += str(temp)
    return checkcode
    while True:
    code = check_code()
    print(code)
    inp = input("<<<")

    if inp.lower() == code.lower() :
    print("验证通过")
    break
    else:
    print("验证错误")

    二.填空题
    test = '胖胖可爱的{0},喜欢在{1}{2}'
    v = input('输入姓名')
    v1 = input("地点")
    v2 = input("爱好")
    n = test.format(v,v1,v2)
    print(n)

    输入姓名王建华
    地点宿舍
    爱好睡觉
    胖胖可爱的王建华,喜欢在宿舍睡觉

    三。敏感词替换
    test = input('<<')
    v1 = test.replace('东京热','***').replace('苍井空','***')
    print(v1)

    <<华仔喜欢看东京热里的苍井空
    华仔喜欢看***里的***

    四.表格呈现输入内容,输入Q或q结束输入

    s = ''
    while True:
    v1 = input("<<<")
    if v1[0:20].lower() == 'q':
    break
    v2 = input("<<<")
    v3 = input("<<<")
    temper = '{0} {1} {2} '
    v = temper.format(v1,v2,v3)
    s +=v
    print(s.expandtabs(20))
    全面发展
  • 相关阅读:
    redis client 2.0.0 pipeline 的list的rpop bug
    Python解释器镜像源修改
    全连接层
    测试(张量)- 实战
    数据加载
    Python之微信-微信好友头像合成
    高阶操作
    MYSQL 查询缓存
    SQL Server 查看指定表上的索引
    MYSQL 查看表上索引的 1 方法
  • 原文地址:https://www.cnblogs.com/snowony/p/11594213.html
Copyright © 2011-2022 走看看