Question
I have a python project where i want to write a function named survey . The function takes in a file name as a parameter.
I have a python project where i want to
write a function named survey. The function takes in a file name as a parameter. The
function will ask three questions:
What is your favorite type of soft drink. The user must answer this or the
function will exit
What is your favorite brand of that soft drink? This response is not required. If
the user enters nothing, the value will be "NA"
The age of the person. It must be a valid number.
If all the information is entered correctly, the survey results are added to the file.
Each survey on its own line and each value separated by commas.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started