Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading