Python 函数打印空行
我需要创建一个名为Python 函数打印空行,python,function,parameters,Python,Function,Parameters,我需要创建一个名为nine_lines的函数,该函数将使用另一个名为three_lines的函数来打印九个空行 这就是我所拥有的,使用3.4 #creating a function within a function def new_line(): print() def three_lines(): new_line() new_line() new_line() def nine_lines(): three_li
nine_lines
的函数,该函数将使用另一个名为three_lines
的函数来打印九个空行
这就是我所拥有的,使用3.4
#creating a function within a function
def new_line():
print()
def three_lines():
new_line()
new_line()
new_line()
def nine_lines():
three_lines()
three_lines()
three_lines()
nine_lines
它打印
>>> ================================RESTART================================
>>>
>>>
我想你错过了调用函数的九行后面的“()”
打印9行的另一种方法是使用循环:
for i in range(9):
print()
你从不调用你的函数。由于打字错误,投票结束时缺少
()
。
for i in range(9):
print()