Κεφάλαιο 7 - Βιβλίο-Τετράδιο Εργασιών Μαθητή

Page 1 of 25

Question 1

Δίνονται οι δύο συναρτήσεις

def python3():

        for i in range(3):

                print "python"

def python9():

        for i in range(9):

                print "python"

Ποια νέα συνάρτηση θα εμφάνιζε 21 φορές τη λέξη python, χρησιμοποιώντας μόνο τις παραπάνω δύο συναρτήσεις;

 

def python21():

        python9()

        python9()

        python3()

def python21():

        python9(2)

        python3(1)

def python21():

        2*python9() +  python(3)

def python21():

        python3()

        python3()

        python9()