Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I can't understand how to
#1
Question 
This is my code:
name = input("What is your name? ")
print( "Hello " + name )
Age = input("What is your age? ")
 if Age = < 60:
    print( "You're old")
 else:
    print( "You're young")
And i have a question :how to make that the code runs separate?
buran write Mar-14-2021, 05:50 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.

Also, please don't start new threads unnecessarily.
Reply
#2
(Mar-14-2021, 05:20 PM)Dayago Wrote: how to make that the code runs separate?
What do you mean by that?

Note that input() will return str and you need to convert it to int before being able to compare it with 60.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

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