I am getting an error message whenever I try and run this

Question:

score = input("what you score bro: ")
if score > 1000:
  print("winner")
else:
  print("loser")

(I am a complete noob). Idk why im getting an error looks right to me.

I tried it on my own then I watched the video again and looked at the bald guys code and mine looks the same idk whats wrong

Asked By: Stef

||

Answers:

It’s not a well-formulated question, but that doesn’t mean newcomers shouldn’t be helped out. Python relies on proper spacing.

If that’s not your issue, you need to know that python will take input as a string, so you need to cast it explicitly to an integer

The following will work. Note the spacing and the explicit cast to an integer type:

score = input("what you score bro: ")
score = int(score)
if score > 1000:
    print("winner")
else:
    print("retard")
Answered By: Tclack88
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.