Computer Science, asked by diljotsinghdhillon, 10 months ago

write a Python program to display age is greater than 18 or not​

Answers

Answered by Kaustav26
30

Answer:

age = int(input("Enter Age:"))

if age=>18:

print ("Your age is greater than 18")

else:

print ("Your age isn't greater than 18")

Answered by AskewTronics
4

Below are the python program for the above problem:

Explanation:

if int(input("enter the user age to verify the adult: "))<18:  #it is used to take the input and check with 18.

   print ("The user age is not greator than 18")

# print for the true if.

else:  # else statement for the false if.

   print ("The user age is not greator than 18") # print for the false if.

Output:

  • If the user input as 8, then the output is "The user age is not greator than 18".
  • If the user input as 28, then the output is "The user age is greator than 18".

Code Explanation:

  • The above code is in python language in which the first line is used to render the message for the user inputs and check the value with the 18 to be less.
  • If the condition is true then it will render the output that the value is not greater otherwise it prints the value is greater.

Learn more:

  • Python code : https://brainly.in/question/13107107
Similar questions