摘要:
"""三元表达式"""#针对以下需求def func(x,y): if x > y : return x else: return yres=func(33,44)print(res)#三元表达式#语法格式:#条件成立的返回值 if 条件 else 条件不成立要返回的值x=1y=2res = x i 阅读全文
posted @ 2020-12-17 21:17
正霜霜儿
阅读(188)
评论(0)
推荐(0)
摘要:
def dog(name): print("道哥%s准备吃东西了"%name) while True: x=yield None #x拿到的是yield 接收到的值 print("道哥%s吃了%s"%(name,x)) g=dog("alex") print(g.__next__()) print( 阅读全文
posted @ 2020-12-17 21:04
正霜霜儿
阅读(96)
评论(0)
推荐(0)
浙公网安备 33010602011771号