Python Forum
i need help with a small code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i need help with a small code
#2
A bare digit in your code is interpreted as a literal int. But input() always returns a str. Those can never be equal.

You need to either store and compare to strs, or you need to cast your input into an int or float. (via int() or float())
Reply


Messages In This Thread
i need help with a small code - by Jacobthefirst - Sep-22-2021, 01:33 PM
RE: i need help with a small code - by bowlofred - Sep-22-2021, 03:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  small code for sampel asn1ate borys 0 870 Jul-26-2022, 10:48 AM
Last Post: borys
  Can someone explain this small snippet of code like I am a 5 year old? PythonNPC 3 1,246 Apr-08-2022, 05:54 PM
Last Post: deanhystad
  Quick Help - Timers - Need Small Solution for Working Code EwH006 5 4,042 Nov-17-2020, 04:09 AM
Last Post: EwH006
  this small code dosento work juanb007 2 2,697 Dec-18-2017, 01:15 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020