Я нахожусь в программировании с использованием класса python, и наша домашняя работа - сделать 99 бутылок пивной песни. Мы еще не научились много еще, так что это действительно все, что я могу придумать:Пытаясь ввести 99 бутылок пива в python
def StandardVerse():
print n, "bottles of beer on the wall,", n, ",bottles of beer"
print "take one down pass it around,",n,"bottles of beer on the wall."
def TwoBottles():
print "Two bottles of beer on the wall, two bottles of beer."
print "Take one down pass it around, one bottle of beer on the wall."
def OneBottle():
print "One bottle of beer on the wall, One bottle of beer."
print "Take one down, pass it around, no more bottles of beer on the wall."
def NoBottles():
print "No more bottles of beer on the wall, no more bottles of beer."
print "Go to the store, buy some more, 99 bottles of beer on the wall."
for n in range(99,0,-1):
if n > 2:
print StandardVerse
if n == 2:
print TwoBottles
if n == 1:
print OneBottle
if n <= 1:
print NoBottles
Это дает мне это, когда я запустить его
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function StandardVerse at 0x027BEC30>
<function TwoBottles at 0x027BEC70>
<function OneBottle at 0x027BECB0>
<function NoBottles at 0x027BECF0>
и так далее до 99 бутылок (Я не копировал все это ради пространства.)
Что я могу сделать, чтобы распечатать эту песню?
Если вы собираетесь печатать функцию вызовов затем возвращать строки или еще не pting просто позвонить –