摘要:
#算法:是高效解决问题的办法#算法之二分法#在列表中寻找自己想要的那一个值# l=[11,22,33,44,66,88,99,111,333,555]# need_value=111# for i in l:# if i==need_value:# print("find it")# break#方 阅读全文
摘要:
#列表生成器l=["xiaozhan","wangyibo_dsb","zhuyilong_dsb","huyitian"]# l_new=[]# for name in l:# if name.endswith("dsb"):# l_new.append(name)# print(l_new)#类 阅读全文
摘要:
"""三元表达式"""#针对以下需求def func(x,y): if x > y : return x else: return yres=func(33,44)print(res)#三元表达式#语法格式:#条件成立的返回值 if 条件 else 条件不成立要返回的值x=1y=2res = x i 阅读全文