Question: RESTART : C:UsersazokoDesktopFall 2019CSC 242Week 1HNIIH-Solution.py Please enter your full name: Anthony Zoko Please enter the city you were born in: Chicago Please enter your
RESTART : C:\Users\azoko\Desktop\Fall 2019\CSC 242\Week 1\HNIIH-Solution.py Please enter your full name: Anthony Zoko Please enter the city you were born in: Chicago Please enter your age: 99 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 you for participating ! Summary: Bruce Wayne Na City: Gotham Age: 50 >>> survey('log.txt") Please enter your full name: Clark Kent Please enter the city you were born in: Metzopolis Please enter your age: 45 Thank you for participating ! Summary Name: Clark Kent City: Metropolig Age: 45 Anthony Zok:Chicago:99 Bruce Wayne:Gotham:50 Clark Kent Metropolis A5 Question 6(25 points): Write a function named survey). The function asks the user for 3 pieces of information: full name, city they were bom 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 catch all file access errors. The file should like something like this after 3 runs of the function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
