1.1-Introductie-Programmeren

Calculating the Titanic survival rate

Difficulty: Filled Filled Filled

In this exercise you’ll create a program that does some basic analysis on the (official) Titanic survivor list. This time, we’ll keep it simple and investigate what the survival rates of the passengers are, based on the class of their accommodation (class one being fancy, class three being below decks). The dataset contains a passenger list and includes whether or not a person survived (in the form of an integer: 0 = no, 1 = yes),

Create a program that processes the Titanic survivor data and shows the output as given in the example.

Note: You do not need to use a list for this exercise. You can use some separate variables to keep track of the numbers.

Example

Example