06: Python: Data Types

Extend it:

Convert and use different types of data
Python Data types: Convert and use different types of data

Here’s a starting point for a project that plots a chart showing how many hours each day the user spends on different activities

Challenges:

 
  1. Add 3 more questions (such as how many days do you spend at school each day)

    Add more lines like 3, 4 or 5 that ask a question, convert the answer to an integer then save it into a variable

  2. Add the answers to your questions to the chart

    Add more lines like 10, 11 or 12 that display a # for each hour that the user does a particular activity

  3. Work out the percentages for each activity and display them on screen.

    Look back at the Try It example code if you want to see how to calculate the percentages.

Remember to be careful to convert data to the most suitable data type using the str(...) float(...) and int(...) functions.

Leave a Reply