Python Programming Question Python 3 PROGRAM A: APROGRAM.py 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 and then use a loop to add ten integers to the list, each in the range from 10-90. These integers will represent angles measured in degrees. main should then call playlist and savelist, in that order. Both of these functions take the 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 number and sum of the even numbers and the number and sum of the odd numbers. The savelist function: save list should sort the list and write each element to a text file named AB.txt, each element on its own line. PROGRAM B: BPROGRAM.py This program should read the angles from AB. txt and generate a table showing the trigonometric ratios sine, cosine, and tangent of the angles. The ratios should be displayed in formatted columns accurate to 5 decimal places as shown in the sample output below. SAMPLE OUTPUT: Here are the angles in degrees: 23 85 31 55 42 85 72 33 39 20 3 even angles total to 134 7 odd angles total to 351 List of angles was written to file. End of program A. Angle Sine Cosine Tangent 0.36397 20 0.34202 0.93969 23 0.39073 0.92050 0.42447 31 0.51504 0.85717 0.60086 33 0.54464 0.83867 0.64941 15רר0.77 0.74314 0.57358 0.30902 39 0.62932 0.80978 42 0.66913 0.90040 55 0.81915 1.42815 72 0.95106 3.07768 0.99619 0.99619 End of program B. 85 0.08716 11.43005 85 0.08716 11.43005
Python Programming Question Python 3 PROGRAM A: APROGRAM.py 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 and then use a loop to add ten integers to the list, each in the range from 10-90. These integers will represent angles measured in degrees. main should then call playlist and savelist, in that order. Both of these functions take the 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 number and sum of the even numbers and the number and sum of the odd numbers. The savelist function: save list should sort the list and write each element to a text file named AB.txt, each element on its own line. PROGRAM B: BPROGRAM.py This program should read the angles from AB. txt and generate a table showing the trigonometric ratios sine, cosine, and tangent of the angles. The ratios should be displayed in formatted columns accurate to 5 decimal places as shown in the sample output below. SAMPLE OUTPUT: Here are the angles in degrees: 23 85 31 55 42 85 72 33 39 20 3 even angles total to 134 7 odd angles total to 351 List of angles was written to file. End of program A. Angle Sine Cosine Tangent 0.36397 20 0.34202 0.93969 23 0.39073 0.92050 0.42447 31 0.51504 0.85717 0.60086 33 0.54464 0.83867 0.64941 15רר0.77 0.74314 0.57358 0.30902 39 0.62932 0.80978 42 0.66913 0.90040 55 0.81915 1.42815 72 0.95106 3.07768 0.99619 0.99619 End of program B. 85 0.08716 11.43005 85 0.08716 11.43005
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
.

Transcribed Image Text:Python Programming Question Python 3
PROGRAM A: APROGRAM.py
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
and then use a loop to add ten integers to
the list, each in the range from 10-90. These
integers will represent angles measured in
degrees. main should then call playlist and
savelist, in that order. Both of these
functions take the 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 number and sum
of the even numbers and the number and sum of
the odd numbers.
The savelist function:
save list should sort the list and write each
element to a text file named AB.txt, each
element on its own line.
PROGRAM B: BPROGRAM.py
This program should read the angles from
AB. txt and generate a table showing the
trigonometric ratios sine, cosine, and
tangent of the angles. The ratios should be
displayed in formatted columns accurate to 5
decimal places as shown in the sample output
below.
SAMPLE OUTPUT:
Here are the angles in degrees:
23 85 31 55 42 85 72 33 39 20
3 even angles total to 134
7 odd angles total to 351
List of angles was written to file.
End of program A.
Angle
Sine
Cosine
Tangent
0.36397
20
0.34202
0.93969
23
0.39073
0.92050
0.42447
31
0.51504
0.85717
0.60086
33
0.54464
0.83867
0.64941
39
0.62932
15ר0.77
0.80978
42
0.66913
0.74314
0.90040
55
0.81915
0.57358
1.42815
72
0.95106
0.30902
3.07768
85
0.99619
0.08716
11.43005
0.99619
End of program B.
85
0.08716
11.43005
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 6 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education