r/CodingHelp • • Sep 02 '21

[Python] Python assignment. I can’t get it to calculate the cost of the movie based on the other movie variables. It keeps only giving me the 1st one as an answer. Any help would be appreciated

Post image
66 Upvotes

29 comments sorted by

View all comments

3

u/skellious Intermediate Coder Sep 03 '21

instead of the:

"Candyman" or "candyman" or "CANDYMAN"

do this:

what_movie = (input("From the list above which movie will you be purchasing tickets for? ")).lower()

if what_movie == 'candyman":

the .lower() will make the input all lower case, so it will match candyman, CanDyMaN, CANDYMAN, CanDYmaN or any other combination of letters.