Python Forum
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No option to input
#7
why not keep it as simple as possible? There is no need for using class, or even a function ro complete this task. You already did it ore or less:
name = input('What is your name? ')
age = input('How old are you? ')
print("Cool, {}.. and your age is {}. You will turn 100 in year {}.".format(name,age, 2017 - int(age)+100))
that is, assuming you are using python3
Reply


Messages In This Thread
No option to input - by Sp00f - Mar-17-2017, 08:37 PM
RE: No option to input - by buran - Mar-17-2017, 08:51 PM
RE: No option to input - by Sp00f - Mar-17-2017, 08:54 PM
RE: No option to input - by buran - Mar-17-2017, 08:59 PM
RE: No option to input - by Sp00f - Mar-17-2017, 09:15 PM
RE: No option to input - by nilamo - Mar-17-2017, 08:59 PM
RE: No option to input - by buran - Mar-17-2017, 09:45 PM
RE: No option to input - by Sp00f - Mar-17-2017, 09:52 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020