Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why this no work ?

    voting_age = 18
    user_age = int(input("What is your age")
    if userage >= voting_age:
    print("You are old enough to vote")
    elif print("You are too young to vote")
    input()

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    29,254
    Thanks
    83
    Thanked 4,890 Times in 4,851 Posts
    You don't have any "if" test following the elif

    You need to use else instead of elif
    Be yourself. No one else is as qualified.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •