Question: Question 6(25 points): Write a function named survey(). The function asks the user for 3 pieces of information: full name, city they were born in

 Question 6(25 points): Write a function named survey(). The function asks
the user for 3 pieces of information: full name, city they were

Question 6(25 points): Write a function named survey(). The function asks the user for 3 pieces of information: full name, city they were born in and age. The function appends that information the user entered to a file and tracks all the results of the survey. Each survey is on its own line in the file and each answer is separated by a. When the user is done with the survey, the function should print a thank you message to the screen with a summary of what the user entered. The function should catclh all file access errors. The file should like something like this after 3 runs of the function: RESTART: C:lUserslazoko Desktop Fal1 20191CSC 242\Week 11HWINHW1-Solution.py Please enter your full name: Anthony Zoko Please enter the city you were born in: Chicago Please enter your age: 99 2 Thank you for participating! Summary: Name: Anthony Zoko City: Chicago Age: 99 >>survey('log.txt) Please enter your full name: Bruce Wayne Please enter the city you were born in: Gotham Please enter your age: 50 Thank you for participating Summary: Name: Bruce Wayne City: Gotham Age: 50 >>> urvey ( . log . txt . ) Please enter your full name: Clark Kent Please enter the city you were born in: Metropol1s Please enter your age: 45 Thank you for participating Summary: Name: Clark Kent City: Metropolis Age: 45 Anthony Zoko:Chicago:99 Bruce Wayne:Gotham:50 Clark Kent:Metropolis:45

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 Databases Questions!