我是新来的python,所以我想创建一些简单的程序来学习更多。Python循环问题
这个程序,我需要与旨在帮助执行以下步骤:
- 要求一个名字
- 询问多次重复的东西在一首歌
- 打印出给定歌词给定的次数
但我有一个问题,它不重复,我做错了什么?
def bSong(name):
print('Happy Birthday to you!')
print("Happy birthday dear " + name + "")
def main():
times = int(input('Enter the number of times to repeat: '))
for i in range(times):
name = input("What is the name of the birthday person: ")
bSong(name)
main()