MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/pythonhelp/comments/i24q36/titlefuction_help_please/g01rkow/?context=3
r/pythonhelp • u/TheDevine13 • Aug 02 '20
19 comments sorted by
View all comments
1
What exactly are you trying to do?
1 u/TheDevine13 Aug 02 '20 Just trying to add the title function and it errors and I have no idea why 1 u/NamasteWager Aug 02 '20 Oh I see now. You are calling it against the entire list, not against a string. Try music[0].title()If you want to print the whole list, you will have to write a loop to do so 1 u/TheDevine13 Aug 02 '20 Ik I can do it that way but I've put in this coding like this before and it worked so I'm not sure what the difference was 1 u/NamasteWager Aug 02 '20 Music is a list, and a list does not have the title function. Make music = 'em' and it will work 1 u/TheDevine13 Aug 02 '20 This makes sense but idk how I did something like this before 1 u/TheDevine13 Aug 02 '20 However I just tried it and that didn't work either lol 1 u/NamasteWager Aug 02 '20 What was the new error 1 u/TheDevine13 Aug 02 '20 Same as before. "List" object has no attribute"title" 1 u/NamasteWager Aug 02 '20 You are still calling the list music. Make a new variable called musictemp, set it to 'test' and then try musictemp.title() 1 u/TheDevine13 Aug 02 '20 That worked, thank you! 1 u/TheDevine13 Aug 02 '20 I'll try that!
Just trying to add the title function and it errors and I have no idea why
1 u/NamasteWager Aug 02 '20 Oh I see now. You are calling it against the entire list, not against a string. Try music[0].title()If you want to print the whole list, you will have to write a loop to do so 1 u/TheDevine13 Aug 02 '20 Ik I can do it that way but I've put in this coding like this before and it worked so I'm not sure what the difference was 1 u/NamasteWager Aug 02 '20 Music is a list, and a list does not have the title function. Make music = 'em' and it will work 1 u/TheDevine13 Aug 02 '20 This makes sense but idk how I did something like this before 1 u/TheDevine13 Aug 02 '20 However I just tried it and that didn't work either lol 1 u/NamasteWager Aug 02 '20 What was the new error 1 u/TheDevine13 Aug 02 '20 Same as before. "List" object has no attribute"title" 1 u/NamasteWager Aug 02 '20 You are still calling the list music. Make a new variable called musictemp, set it to 'test' and then try musictemp.title() 1 u/TheDevine13 Aug 02 '20 That worked, thank you! 1 u/TheDevine13 Aug 02 '20 I'll try that!
Oh I see now. You are calling it against the entire list, not against a string. Try music[0].title()
If you want to print the whole list, you will have to write a loop to do so
1 u/TheDevine13 Aug 02 '20 Ik I can do it that way but I've put in this coding like this before and it worked so I'm not sure what the difference was 1 u/NamasteWager Aug 02 '20 Music is a list, and a list does not have the title function. Make music = 'em' and it will work 1 u/TheDevine13 Aug 02 '20 This makes sense but idk how I did something like this before 1 u/TheDevine13 Aug 02 '20 However I just tried it and that didn't work either lol 1 u/NamasteWager Aug 02 '20 What was the new error 1 u/TheDevine13 Aug 02 '20 Same as before. "List" object has no attribute"title" 1 u/NamasteWager Aug 02 '20 You are still calling the list music. Make a new variable called musictemp, set it to 'test' and then try musictemp.title() 1 u/TheDevine13 Aug 02 '20 That worked, thank you! 1 u/TheDevine13 Aug 02 '20 I'll try that!
Ik I can do it that way but I've put in this coding like this before and it worked so I'm not sure what the difference was
1 u/NamasteWager Aug 02 '20 Music is a list, and a list does not have the title function. Make music = 'em' and it will work 1 u/TheDevine13 Aug 02 '20 This makes sense but idk how I did something like this before
Music is a list, and a list does not have the title function. Make music = 'em' and it will work
1 u/TheDevine13 Aug 02 '20 This makes sense but idk how I did something like this before
This makes sense but idk how I did something like this before
However I just tried it and that didn't work either lol
1 u/NamasteWager Aug 02 '20 What was the new error 1 u/TheDevine13 Aug 02 '20 Same as before. "List" object has no attribute"title" 1 u/NamasteWager Aug 02 '20 You are still calling the list music. Make a new variable called musictemp, set it to 'test' and then try musictemp.title() 1 u/TheDevine13 Aug 02 '20 That worked, thank you!
What was the new error
1 u/TheDevine13 Aug 02 '20 Same as before. "List" object has no attribute"title" 1 u/NamasteWager Aug 02 '20 You are still calling the list music. Make a new variable called musictemp, set it to 'test' and then try musictemp.title() 1 u/TheDevine13 Aug 02 '20 That worked, thank you!
Same as before. "List" object has no attribute"title"
1 u/NamasteWager Aug 02 '20 You are still calling the list music. Make a new variable called musictemp, set it to 'test' and then try musictemp.title() 1 u/TheDevine13 Aug 02 '20 That worked, thank you!
You are still calling the list music. Make a new variable called musictemp, set it to 'test' and then try musictemp.title()
1 u/TheDevine13 Aug 02 '20 That worked, thank you!
That worked, thank you!
I'll try that!
1
u/NamasteWager Aug 02 '20
What exactly are you trying to do?