准备工作:
1、调用upper()函数
2、注意有且只能对字母有效。
好啦,下面是实现代码编写,要求:验证码大小写请输入验证码
input_code=input("请输入验证码:") code="xYq3" if code.upper()==input_code.upper(): print("验证通过") else: print("验证失败")
输出结果:
请输入验证码:xyq3 验证通过
上一篇:subprocess模块怎么被更改替换
下一篇:python中怎么用choice函数