Question
The text file myspace_profiles.txt contains information about some people. For each person in the file it has their name, their age, and their favorite color
The text file myspace_profiles.txt contains information about some people. For each person in the file it has their name, their age, and their favorite color each on a new line. Each person is separated by a - on its own line. The file is available in onQ.
In pyhton Write a program, sepreated into functions that adds yourself to the given file at the end of the file, without damaging the previous data. After that, add another person to the file by:
taking the name from the user input
their age should be between 18-22 (randomly generated)
their favorite color is one of green, red, yellow, pink, blue, orange (randomly generated)
Once you are finished writing to the file, display the contents of the file.
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