Blowing in the wind(编程实现) 给以下歌曲加上标题(Blowing in the wind) 作者(Bob Dylan) 和 尾注1962 by Warner Bros. Inc. How many roads must a man walk down Before they call him a man How many seas must a white dove sail Before she sleeps in the sand How many times must the cannon balls fly Before they're forever banned The answer my friend is blowing in the wind The answer is blowing in the wind
时间: 2023-06-10 10:04:37 浏览: 314
Answer:
以下是我为这首歌加上标题(Blowing in the Wind)和尾注1962 by Warner Bros. Inc.的实现代码,如下所示:
```
def add_title_and_copyright():
song_title = "Blowing in the Wind"
song_author = "Bob Dylan"
year = 1962
copyright = "Warner Bros. Inc."
# Lyrics of the song
lyric1 = "How many roads must a man walk down"
lyric2 = "Before they call him a man"
lyric3 = "How many seas must a white dove sail"
lyric4 = "Before she sleeps in the sand"
lyric5 = "How many times must the cannon balls fly"
lyric6 = "Before they're forever banned"
lyric7 = "The answer my friend is blowing in the wind"
lyric8 = "The answer is blowing in the wind"
# Combine title, author, and year with lyrics
full_lyrics = song_title + "\n" + "Author: " + song_author + "\n" + "Year: " + str(year) + "\n" \
+ lyric1 + "\n" + lyric2 + "\n" + lyric3 + "\n" + lyric4 + "\n" \
+ lyric5 + "\n" + lyric6 + "\n" + lyric7 + "\n" + lyric8 + "\n" \
+ "©" + str(year) + " " + copyright
return full_lyrics
```
调用该函数即可得到加上标题和版权信息的歌曲lyrics,如下所示:
```
print(add_title_and_copyright())
```
输出结果如下:
```
Blowing in the Wind
Author: Bob Dylan
Year: 1962
How many roads must a man walk down
Before they call him a man
How many seas must a white dove sail
Before she sleeps in the sand
How many times must the cannon balls fly
Before they're forever banned
The answer my friend is blowing in the wind
The answer is blowing in the wind
©1962 Warner Bros. Inc.
```
阅读全文