0

I was writing a simple python program in pyCharm, but this program is not working as expected! The code is:

value= input("""Assign a whole number to x, such that 23< x >25:""")
if value==24:
    print("""Correct! Your are the next Bertrand Russell!!""" )
else:
    print("""Wrong. Try again!""")

But even if I assign the value 24 to x, I get

Wrong. Try again!

as output!

Is there any mistake in my understanding? Or is it just a pyCharm bug?

  • 1
    `input` always returns a string, which won't be equal to a number. – deceze Sep 24 '20 at 09:22
  • 1
    if value=="24": – Arthur Rubens Sep 24 '20 at 09:24
  • Please post textual information as text, notvas a screenshot. Also choose a helpful title. Most questions here are about programs not working as expected. – Klaus D. Sep 24 '20 at 09:34
  • @Klaus D I have posted textual information and screenshot, as well, for clarity. The title is helpful, at least to me, as it clearly indicates that the problem is related to python and the problem is in unexpected result I am getting. Isnt it helpful? –  Sep 24 '20 at 09:45
  • @deceze thanks, now I can see where the problem is. –  Sep 24 '20 at 10:53

0 Answers0