def listingLyrics(song):
"""
returns the lyrics of a song in a list, and lowercased
"""
lyricList = []
song = song.lower()
alphabet = 'abcdefghijklmonpqrstuvwxyz' #characters to be used in lyrics
lyric = ''
for char in song:
if char not in alphabet:
lyricList.append(lyric)
lyric = '' #reset lyric value, but returns many ['']
continue
else:
lyric += char
lyricList = [e for e in lyricList if e not in ''] #added this to remove [''] from list
return lyricList
x = "She! loves you, yeah, yeah, yeah She loves you, yeah, yeah, yeah She loves you, yeah, yeah, yeah, yeah."
y = "can't"
Hey everyone, so I'm doing this as a challenge for myself, a program that returns lyrics of a song in a list, all lowercased. For example, listingLyrics(x) returns ['she', 'loves', 'you', 'yeah', 'yeah', 'yeah', ...]. Is there a more efficient way to make this work, with smaller steps, and perhaps removing the list comprehension? Or is the list comprehension necessary? Can this be done recursively? Thanks.