ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

Help me pls[Python]


  • Please log in to reply
Help me pls[Python]

#1

XxxDIxxX
XxxDIxxX
    Offline
    -2
    Rep
    0
    Likes

    Member

Posts: 37
Threads: 1
Joined: Oct 01, 2020
Credits: 0
Three years registered
#1
age=int(input("Inter your age"))

A program is needed in which if the age is greater than or less than 18, the program is returned at the time of input. And if it is equal to 18 then the program continues to work

  • 1

#2

D1NO
D1NO
    Offline
    1838
    Rep
    2851
    Likes

    :sleep:

    [STAFF]
Posts: 6296
Threads: 467
Joined: Jan 29, 2016
Credits: 50

Eight years registered
#2

age=int(input("Inter your age"))

A program is needed in which if the age is greater than or less than 18, the program is returned at the time of input. And if it is equal to 18 then the program continues to work

 

like this?

age = int(input("Enter your age: "))
if age < 18 or age > 18:
    print(f"Your age without equal: {age}")
elif age == 18:
    print(f"Your age with equal: {age}")

  • -1

Best dude - Jim2244

-----------------------------------------------------------------

I WILL NEVER ADD YOU FIRST

ALWAYS PM ME FIRST ON NULLED BEFORE DEALING IN THIRD PARTY APPLICATIONS

-----------------------------------------------------------------

DIVI ELEGANT THEMES - Config Services - Reddit Services


#3

XxxDIxxX
XxxDIxxX
    Offline
    -2
    Rep
    0
    Likes

    Member

Posts: 37
Threads: 1
Joined: Oct 01, 2020
Credits: 0
Three years registered
#3

like this?

age = int(input("Enter your age: "))if age < 18 or age > 18:    print(f"Your age without equal: {age}")elif age == 18:    print(f"Your age with equal: {age}")
Exactly, thx dude.
+rep

  • 0


 Users browsing this thread: