Question
This program should use a main function and two other functions named playlist and savelist as follows: The main function: The main function should create
This program should use a main function and two other functions named playlist and savelist as follows: The main function: The main function should create an empty list named nums and then use a loop to add ten integers to nums, each integer in the range from 10-90. NOTE: In Python, a list is a data type. See Chapter 7. The main function should then call the playlist function and savelist function, in that order. Both of these functions take the nums list as a sole argument. The playlist function: playlist should use a loop to display the elements of the list, all on one line separated by a single space. playlist should also determine and print the total of the even numbers and the total of the odd numbers. The savelist function: save list should sort the list and write each element to a text file named angles.txt, each element on its own line.
SAMPLE OUTPUT
Here are the integers in nums:
23 85 31 55 42 85 72 33 39 20
Even integers total to 134
Odd integers total to 351
List of integers was written to file.
End of program.
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