Skip to content

Worked Solutions to the 10 StemPy17 Programming Challenges from Day 1

Notifications You must be signed in to change notification settings

amos1969/stempy17-challenges

Repository files navigation

StemPy17 Challenges

Solutions to the following Programming Challenges from the StemPy17 Day 1 content.

  1. Develop a system that will ask a user for their name and the year of their birth, then repeat this information back to them, by displaying the following message, "Hello name. You were born in the year 2001"

  2. Add a feature that will guess the user's age then display the following message, "Hello name. Since you were born in the year 2001, I think you are 16 years old"

  3. Add in some data validation to check that the user is giving a valid year of birth. If they don't ask, make the program continually ask the question until they provide a valid year.

  4. Add a feature where it tells the user an interesting fact based on their age, eg. "Since most humans sleep for about a third of their life, that means you have slept for a total of 5 years"

  5. If the user has not had their birthday yet, it's likely that the prediction about their age is 1 year higher than it should be. Ask the user if the age prediction is correct, if they say no, then adjust their age accordingly and display the correct age.

  6. Develop the program so that it will execute continually so that the program starts again automatically after the previous user.

  7. If your program is being used next year, it's possible that it will be wrong. Make use of the time module to ensure that your program always gives the correct calculations based on the current year.

  8. Add a feature that will permanently store all data for each user (name, year, age) long after the program has stopped executing or the computer has been shut down.

  9. Add a date/time stamp to the data, so that you know when a user entered the data.

  10. Develop a way to tell the user the name of one other previous user who shares the same birth year, eg. "You were born in the same year as Michael"

There are also two sets of example code, covering the sessions on functions and the sessions on file input/output.

About

Worked Solutions to the 10 StemPy17 Programming Challenges from Day 1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages