例:密码必须有大写字母,小写字母,数字数组
password =____________ #__里面能够用input(),也能够自定义输入dom
A='ABCD.....'3d
B='abcd.......'code
C='1234.......'blog
count_1,count_2,count_3=False,False,False #给参数赋值排序
for i in password:input
if i in A:it
count_1=Truefor循环
if i in B:import
count_2=True
if i in C:
count_3=True
if count_1 and count_2 and count_3:
print('OK')
else:
print('密码必须有大写字母,小写字母,数字')
--------------------------------------------------------------------------------------------------------------------
例:计算器
---------------------------------------------------------------------------------------------------------------
例:随机输出
#######这是用VS code
########这是用Jupyter
----------------------------------------------------------------------------------------------------------------
银行输密码(3次)---------用for循环
--------------------------------------------------------------------------------------------------------------------
数组中随机输出:
--------------------------------------------------------------------------------------------------------------------------------------------------------
排序
---------------------------------------------------------------------------------------------------------------------------------------------------------
昨天的例题:
a=int(input('Enter today’s day: '))
b=int(input('Enter the number of days elapsed since today: '))
week=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
wl=(a+b)%7
print("Today is %s and the future day is %s"%(week[a],week[wl]))
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
a,b=map(int,input('输入年份及月份 ').split(','))
if (a%4==0 and a%100!=0) or (a%400==0):
e=int( '29')
else:
e=int( '28')
if b==1 or b==3 or b==5 or b==7 or b==8 or b==10 or b==12 :
t=int( '31')
elif b==4 or b==6or b==9 or b==11:
t=int( '30')
else:
t==e
print('%d 年 %d 月份有 %d 天' %(a,b,t))
-------------------------------------------------------------------------------------------------------------------------------------
########昨天写死了,今天要补死了,啊啊啊啊啊