Comparing string with an input string :: python -


I am trying to compare an input string, but whenever I enter Bark as input, the compiler goes directly to the second condition.

If ignoring the condition and giving me the output "incorrect answer"

  def Main (): First_name = raw_input ("Enter the first name of President Obama:") #Input if firstname == ['B', 'A', 'R', 'A', 'C', 'K'] : Print "right answer" second: print "wrong answer" exit_key = input ('press any key to end')  

Is there any reason you are doing this? Try:

  if first_name == "barac":  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -