Exercise 6 

Write a program in Python language that asks the user to enter their age and display the message "You're Major!" If the age typed is greater than or equal to 18 and the message "you are under age!" If the typed age is less than 18.

Solution

# Ask to type age
age = int(input("Type your age : "))
if(age > 18):
print("You are major !")
else:
print("You are minor !")
Younes Derfoufi
One thought on “Solution Exercise 6”

Leave a Reply