# I follow rivers lyrics play by Chae & Alex
I, I follow, I follow you Deep sea baby, I follow you I, I follow, I follow you Dark doom honey, I follow you
sorted(set(''' I, I follow, I follow you
Deep sea baby,
I follow you
I, I follow,
I follow you
Dark doom honey,
I follow you'''))
['\n', ' ', ',', 'D', 'I', 'a', 'b', 'd', 'e', 'f', 'h', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 'u', 'w', 'y']
content = ' I, I follow, I follow you Deep sea baby, I follow you I, I follow, I follow you Dark doom honey, I follow you'.split()
#splitting the lyrics in a list
content
['I,', 'I', 'follow,', 'I', 'follow', 'you', 'Deep', 'sea', 'baby,', 'I', 'follow', 'you', 'I,', 'I', 'follow,', 'I', 'follow', 'you', 'Dark', 'doom', 'honey,', 'I', 'follow', 'you']
#unique words
sorted(set(content))
['Dark', 'Deep', 'I', 'I,', 'baby,', 'doom', 'follow', 'follow,', 'honey,', 'sea', 'you']
def lyrics(word):
answer = []
if word == 'follow':
answer = 'unfollow'
return answer
lyrics = ['I, I'] + ['follow,'] + ['I'] + ['follow you']
lyrics(['I'], ['I follow'], ['I follow you'])
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) /tmp/ipykernel_876/1268618959.py in <module> ----> 1 lyrics(['I'], ['I follow'], ['I follow you']) TypeError: 'list' object is not callable
def song(lyrics):
result = []
# if lyrics == 'follow':
for element in lyrics:
if len(element)>4:
result = result + ['un' + element]
if len(element)<4:
result = result + [element]
if len(element)==4:
result = result + [element]
return result
song(lyrics)
['I, I', 'unfollow,', 'I', 'unfollow you']
del print
--------------------------------------------------------------------------- NameError Traceback (most recent call last) /tmp/ipykernel_876/1941634850.py in <module> ----> 1 del print NameError: name 'print' is not defined
with open('/dev/usb/lp0','w') as printer:
print(song(lyrics)*1, file=printer)
lyricstwo = '''I, I follow, I follow you
Deep sea baby,
I follow you
I, I follow,
I follow you
Dark doom honey,
I follow you'''
lyrics.split()
['I,', 'I', 'follow,', 'I', 'follow', 'you', 'Deep', 'sea', 'baby,', 'I', 'follow', 'you', 'I,', 'I', 'follow,', 'I', 'follow', 'you', 'Dark', 'doom', 'honey,', 'I', 'follow', 'you']
lyrics.split('\n') #line break with /n
['I, I follow, I follow you ', 'Deep sea baby, ', 'I follow you ', 'I, I follow, ', 'I follow you ', 'Dark doom honey, ', 'I follow you']
lyrics
'I, I follow, I follow you \nDeep sea baby, \nI follow you \nI, I follow, \nI follow you \nDark doom honey, \nI follow you'
print(lyrics)
I, I follow, I follow you Deep sea baby, I follow you I, I follow, I follow you Dark doom honey, I follow you
#
#song(lyrics)
print((lyrics) + ', hello!')
I, I follow, I follow you Deep sea baby, I follow you I, I follow, I follow you Dark doom honey, I follow you, hello!
def song2(lyrics):
result = ''
for word in lyrics:
if word == 'follow':
result = result + 'un' + word
else:
result = result + word
return result
song2(lyrics)
'I, I follow, I follow you \nDeep sea baby, \nI follow you \nI, I follow, \nI follow you \nDark doom honey, \nI follow you'
plusun = 'un'
print((plusun) + (lyrics))
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) /tmp/ipykernel_876/544455959.py in <module> ----> 1 print((plusun) + (lyrics)) TypeError: 'str' object is not callable
plusun * 2
'unun'
plusun + lyrics
'unI, I follow, I follow you \nDeep sea baby, \nI follow you \nI, I follow, \nI follow you \nDark doom honey, \nI follow you'
lyrics.split()
['I,', 'I', 'follow,', 'I', 'follow', 'you', 'Deep', 'sea', 'baby,', 'I', 'follow', 'you', 'I,', 'I', 'follow,', 'I', 'follow', 'you', 'Dark', 'doom', 'honey,', 'I', 'follow', 'you']
plusun + lyrics
'unI, I follow, I follow you \nDeep sea baby, \nI follow you \nI, I follow, \nI follow you \nDark doom honey, \nI follow you'
lyrics.split('\n')
['I, I follow, I follow you ', 'Deep sea baby, ', 'I follow you ', 'I, I follow, ', 'I follow you ', 'Dark doom honey, ', 'I follow you']
#lyrics = lyrics.split('\n')
" un ".join(lyrics)
'I, I un follow, un I un follow you'
lyricstwo
'I, I follow, I follow you \nDeep sea baby, \nI follow you \nI, I follow, \nI follow you \nDark doom honey, \nI follow you'
lyricstwo.count("follow")
6