Advertisement
naren_paste

Nested Conditionals

Aug 14th, 2023
781
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | Source Code | 0 0
  1. a = int(input('Enter the age of the person: '))
  2. b = str(input('Enter the citizenship of the person: '))
  3. c = str(input('Do he/she have a voter ID card? '))
  4. if a >= 18:
  5.     if b == 'Indian':
  6.         print('You are Indian and you can vote')
  7.         if c == 'yes':
  8.             print('Yes, you are eligible to vote')
  9.         else:
  10.             print('You are not eligible to vote')
  11.     else:
  12.         print(""Sorry, you are not a citizen so you can't vote"")
  13. else:
  14.    print(""Sorry, you are not eligible to vote"")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement