Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
splitting a random song
#4
When you call...

while True:
            random_song, random_artist = song_selection(songnames, songartists)
            split_song(songnames)
            break
You are passing songnames (a list) to split_song. A list does not have "split" as the error mentions. Instead you should pass the random_song that you have chosen previously in song_selection.

And then something like:
def split_song(random_song):
    for word in random_song.split(" "):
        print(word[0])
By the way, your username/password checking process allows the users to guess if any other person has certain password, what is in most scenarios a bad idea.
Reply


Messages In This Thread
splitting a random song - by Unknown_Relic - Nov-14-2019, 10:37 AM
RE: splitting a random song - by ichabod801 - Nov-14-2019, 01:28 PM
RE: splitting a random song - by baquerik - Nov-15-2019, 01:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Song Modifying Program Starting Point BadenJaden 1 1,887 Mar-27-2020, 11:36 AM
Last Post: pyzyx3qwerty
  random selection of song and artist not working Unknown_Relic 2 2,355 Nov-08-2019, 02:06 PM
Last Post: perfringo
  How to play a song .wav or .mp3 with audioop native library IvanSilva 3 6,568 Mar-14-2018, 10:49 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020