最新回答 / thim123
這個是python2和python3里的區別?C:\WINDOWS\system32>python2Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> print [a + b + c for a ...
2017-10-17
最贊回答 / 李小美0
我試了這種,只輸出HELLO,好像是函數一旦產生返回值后就不繼續執行了至于你那種是否語法不支持?麻煩高手回復一下我def toUppers(L):? ? for s in L:? ? ? ? if isinstance(s,str):? ? ? ? ? ? return s.upper()print toUppers([000,'Hello', 'world', 101])
2017-10-15
最新回答 / 慕粉0100288097
因為你的函數里面有一個return greet(),程序執行函數時,在函數內部又會執行一次函數,然后就循環了,一次不停的在函數內部調用自己。解決辦法就是去掉return后的greet()def greet(x=1):? ? ? ?if x == 1:? ? ? ? ? ? ?print('Hello,world.')? ? ? ?else:? ? ? ? ? ? ?print('Hello,%s.'%x)? ? ? ?returngreet('Bart')
2017-10-14