0

What I want to happen is if the number is over 500 for the console to print something, but right now it counts how long the number is not how high its numerical value is.

print ("What Is The Current Distance  In Meters?")
distance = input ()

if len (distance) >= 500:
    (print) ("Thanks")
martineau
  • 119,623
  • 25
  • 170
  • 301
J.D
  • 3
  • 1

2 Answers2

0

You need to first convert distance to a number and then use the greater than operator > so you code becomes:

print ("What Is The Current Distance  In Meters?")
distance = input ()

if int(distance) > 500 :
    print ("Thanks")

Hope I helped!

BluCode
  • 1,097
  • 7
  • 16
0

input() is always a string - you likely want distance = int(input())

smulloy
  • 16
  • 1
  • 2