help me i am trying to create an program where we enter our age and it will reply us that we are eligible for voting or not but | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

help me i am trying to create an program where we enter our age and it will reply us that we are eligible for voting or not but

a=input('enter your age to check your eligibiity:') print (a) if a>=18: print('Congratulations! You are eligible for voting.') else: print('Sorry ! You cannot vote')

1st Jun 2019, 10:42 AM
Sumit Jaiswal
Sumit Jaiswal - avatar
3 Answers
+ 2
Use int(input())
1st Jun 2019, 10:44 AM
Trigger
Trigger - avatar
+ 2
age=int(input('your age:')) def eligibility (x) : if x>=18: print ("you can vote") else: print ("you can't vote") eligibility(age)
1st Jun 2019, 7:44 PM
madie
0
Thanks madie
2nd Jun 2019, 1:49 AM
Sumit Jaiswal
Sumit Jaiswal - avatar