CodeSolved

A comprehensive source of programming questions and exercises

User's age check

Practice Easy 56/ Download 1740 Views

Write a program that receives the user's age from the input and checks that if the user was younger than 1, it would be a throw/raise error, otherwise print a welcome message

12 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
age = int(input("Enter your agg :"))
years_ = int(input("Enter your birth year: :"))
y =  2024 - years_
if age == y :
    if age > 20 :
        print("Welcome")
    else:
        print("throw/raise")
else:
    print("Your age does not match your birth year")
Ali.r.h.z Download Python
age = int(input("enter your age number:"))
if age < 20:
    print("throw/raise")
else:
    print("wellcom to in world")
    
i=int(input('age:'))
if i<20:
    raise Exception(' You are too young.')
else:
    print('wellcome.')
age = int(input("how old are you;"))
s = ['you are welcome' if age >20 else "throw/raise" ]
print(s)
Reza189 Download Python
name = input("Enter your name: ")
def age():
    Age = int(input("How old are you: "))
    if Age>13:
         print("welcom", name)
    else:
        print ("Opps, you are younger than virtual age")
age()
Amirali Download Python
a = int(input("age: ")) 
if a < 20:
    print(" error") 
else: 
    print("welcome")
User 49 Download Python
age=int(input("how old are you?"))
if age<20:
	print("throw/rised")
else:
	print( "Welcome :)")
Amirrz Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close