-1

I'm very sorry if it's a super noob question, but I can't even get this to run properly. Am I missing something, I've been searching for 20 mins and I'm getting desperate.

num = input()
if num == 3:
  print("yes its 3")
  • 1
    `input()` returns string. You need `int` - `int(input().strip())` – man0v Feb 26 '18 at 16:07
  • Are you getting any error? – Prabhakar Feb 26 '18 at 16:09
  • 1
    In all honesty, please don't get desperate after just 20 minutes of searching. If you pursue any programming course of study or employment, you will have times when you're searching for literally hours about why a process isn't working like its supposed to. Asking for help can be a very good learning tool, but the most valuable thing you can learn right now isn't simply how to program, but how to find answers to your questions. Get familiar with online tutorials and resources and learn how to be more effective searching without getting desperate, and if you learn that, things will go better. – Davy M Feb 26 '18 at 16:13
  • Right, Sorry. I think I bit more than I could chew on the code I'm working on. I'm just a 10th grader after all. – sean lasono Feb 26 '18 at 16:24
  • Go throught type of input data also, may be type conversation needed – xyz Feb 26 '18 at 16:34

1 Answers1

0

You have a problem with the types. num = input() returns string, but you compare it to int

you could try to run:

num = input()
if num == '3':
  print("yes its 3")
Oleksandr Dashkov
  • 2,249
  • 1
  • 15
  • 29