Question: Write a Python program that uses the TitanicPassengers.txt data file to answer the following questions. 1 . What was the average age of the survivors?

Write a Python program that uses the TitanicPassengers.txt data file to answer the
following questions.
1. What was the average age of the survivors?
2. Who were the oldest and youngest survivors and what were their ages?
3. What was the survival rate (in percent) for each class of passengers?
Each record of the data file is of the form Class, Age, Gender, Survival, Name,
where
Class is an integer from 1 to 3, inclusive,
Age is a decimal giving the passengers age in years,
Gender is either M or F,
Survival is either 1 or 0 with 1 indicating that the passenger survived, and
Name is the honorific and full name of the passenger.
Your program should have a function Titanic() that takes no arguments and prints
the answers to the three questions above in the shell.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!