Learning Python Basics

Posted by StaticExtasy on Stack Overflow See other posts from Stack Overflow or by StaticExtasy
Published on 2012-09-28T03:06:39Z Indexed on 2012/09/28 3:37 UTC
Read the original article Hit count: 61

Filed under:
|

So I'm trying to learn python better and i've been using this website http://www.learnpython.org/

I'm on to functions right now, heres the code

#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()

the output being

e is a benefit of functions!

e is a benefit of functions!

e is a benefit of functions!

r is a benefit of functions!

What am i missing to return the whole scentence

© Stack Overflow or respective owner

Related posts about python

Related posts about function