Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

if statement python problem help?

i have to do this question and i dont know how to use the UCase function:

Display the question: "What is the biggest grossing movie of all time?". Get the answer from a user. If the answer is "TITANIC" then display "Correct", otherwise display "Wrong"

Thank you :)

1 Answer

Relevance
  • SSJ
    Lv 4
    5 years ago
    Favorite Answer

    Well your conditional statement will follow the lines of :

    if input=='TITANIC':

    print 'Correct'

    else:

    print 'Wrong'

    But your input should account for answers like 'titanic', 'Titanic', or any string with the characters for 'TITANIC' (even if they are not necessarily uppercase).

    Maybe your conditional should instead be:

    if input.upper() == 'TITANIC:

    print 'Correct'

    else:

    print 'Wrong'

Still have questions? Get your answers by asking now.