所以我想更好地学习python,我一直在使用这个网站http://www.learnpython.org/
我现在就开始工作了,继承了代码
#Add your functions here (before the existing functions)
def list_benefits():
myList = ['More organized code','More readable code','Easier code reuse','Allowing programmers to share and connect code together']
return myList
def build_sentence(info):
addMe = " is a benefit of functions!"
for i in info:
meInfo = i + addMe
return meInfo
def name_the_benefits_of_functions():
list_of_benefits = list_benefits()
for benefit in list_of_benefits:
print build_sentence(benefit)
name_the_benefits_of_functions()
Run Code Online (Sandbox Code Playgroud)
输出是
e是功能的好处!
e是功能的好处!
e是功能的好处!
r是功能的好处!
我错过了什么才能归还整个场景