1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

Python help

Discussion in 'Coding, Programming' started by fightforspartan, Oct 14, 2016.

  1. a python program IDLE that asks the user how old they are tell them if they are old enough to vote. Then extend the program tell them how many years it is until they can retire (assume at age 65).

    Pa help po using PYTHON IDLE
     
  2. def validate(x):
    s = ""
    if age >= 18:
    til = 65 -age
    s = "allowed to vote til " +str(til)
    else:
    s = "under age"
    return s

    #main
    age = int(input("Enter your age: "))
    print(validate(age))


    #guide mo na lang sir.
     
Tags / Keywords: