最新回答 / tinghai
fs 列表的值是三個(gè)函數(shù)對(duì)象:print(count()) # ==> [<function count.<locals>.f at 0x0000020883FC8180>, <function count.<locals>.f at 0x0000020883FC8220>, <function count.<locals>.f at 0x0000020883FC82C0>]
2020-12-13
# encoding:utf-8
class animal(object):
def __init__(self,name,age):
self.name = name
self.age = age
def get(self):
print(self.name,self.age)
dog = animal("汪汪",3)
cat = animal("喵喵",2)
dog.get()
cat.get()
class animal(object):
def __init__(self,name,age):
self.name = name
self.age = age
def get(self):
print(self.name,self.age)
dog = animal("汪汪",3)
cat = animal("喵喵",2)
dog.get()
cat.get()
2020-12-02
最贊回答 / weixin_慕斯3464934
from?functools?import?reduce def?calc_prod(list_): ????def?lazy_prod(): ????????def?f(x,?y): ????????????return?x?*?y ????????return?reduce(f,?list_,?1) ????return?lazy_prod f?=?calc_prod([1,?2,?3,?4]) f()在最后一行代碼前面加上print?更改后為print f()
2020-11-02
最贊回答 / 真實(shí)如煙
input只接收用戶從鍵盤輸入的內(nèi)容,please input number:不是用戶輸入的內(nèi)容,用戶輸入的內(nèi)容只有201,所以print(num)的時(shí)候結(jié)果是201
2020-10-29
老闊疼??!原來(lái)例子是分?jǐn)?shù),難怪我怎么加都覺(jué)得不對(duì)勁!
2020-10-24