摘要:
计算s中的元素个数 s='abcdefrmcxzoplamc' count=0 for i in s: count+=1 print(count) #17 l=[1,2,3,4] count=0 for i in l: count+=1 print(count)#4 def my_len(): l= 阅读全文
摘要:
案例一 s='dhclvamvmzkfisncnmlwq' count=0 for i in s: count+=1 print(count) #21 案例二 l=[1,2,3,4] count=0 for i in l: count+=1 print(count) #4 函数的使用必须遵循一个原则 阅读全文
摘要:
1.判断下列逻辑语句的True,False 1) 1>1 or 3<4 or 4>5 and2>1 and 9>8 or 7<6 True 2) not 2>1 and 3<4 or 4>5 and 2>1 and 9>8 or 7<6 False 2.求出下列逻辑语句的值 1)8 or 3 and 阅读全文
摘要:
恢复内容开始 一. 循环语句: while 条件: 循环代码 1.打印出100以内的数字 i=0 while i mike xiaojiayu name=["mike","xiaojiayu","xiaohua"] for i in name: if i=="xiaojiayu": continue 阅读全文