can you identify this Python Program below, where it is placed, and explain why and where it is used  by following all the structures. please label where each structure is written...thank you 1.) Sequential Structures 2.) Decision Structures 3.) Repetition Structures 4.) String Methods 5.) Text File Manipulation 6.) Lists and Dictionaries 7.) Functions 8.) Program Modularization import numpy px_terms = int(input('Enter number of terms in px: ')) qx_terms = int(input('Enter number of terms in qx: ')) poly = {} for i in range(px_terms): ele = int(input('Enter coefficient {} for px: '.format(i + 1))) # if 'px' is not present already, add empty list with 'px' as key if 'px' not in poly: poly['px'] = [] # after adding empty list with 'px' as key, append input to the list # I added this line because it also add 1st coefficient to the list. poly['px'].append(ele) # else, append input to the list else: poly['px'].append(ele) for i in range(qx_terms): ele = int(input('enter coefficient {} for qx: '.format(i + 1))) # if 'qx' is not present already, add empty list with 'qx' as key if 'qx' not in poly: poly['qx'] = [] # after adding empty list with 'qx' as key, append input to the list. # I added this line because it also add 1st coefficient to the list. poly['qx'].append(ele) # else, append input to the list else: poly['qx'].append(ele) option = input('Select Addition, Subtraction, Multiplication, Division: ') if option.lower() == "addition": print(numpy.polynomial.polynomial.polyadd(poly['px'], poly['qx'])) if option.lower() == "subtraction": print(numpy.polynomial.polynomial.polysub(poly['px'], poly['qx'])) if option.lower() == "multiplication": total = 0 for i in range(px_terms): ans = poly['px'][i] * poly['qx'][i] print(f"answer{i+1} = ", ans) total += ans print(f"total = {total}") if option.lower() == "division": qu, re = numpy.polynomial.polynomial.polydiv(poly['px'], poly['qx']) print("Quotient: ", qu) print("Remainder: ", re)

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 9PP
icon
Related questions
Question

can you identify this Python Program below, where it is placed, and explain why and where it is used 

by following all the structures. please label where each structure is written...thank you

1.) Sequential Structures

2.) Decision Structures

3.) Repetition Structures

4.) String Methods

5.) Text File Manipulation

6.) Lists and Dictionaries

7.) Functions

8.) Program Modularization

import numpy

px_terms = int(input('Enter number of terms in px: '))
qx_terms = int(input('Enter number of terms in qx: '))

poly = {}

for i in range(px_terms):
ele = int(input('Enter coefficient {} for px: '.format(i + 1)))
# if 'px' is not present already, add empty list with 'px' as key
if 'px' not in poly:
poly['px'] = []

# after adding empty list with 'px' as key, append input to the list
# I added this line because it also add 1st coefficient to the list.
poly['px'].append(ele)

# else, append input to the list
else:
poly['px'].append(ele)


for i in range(qx_terms):
ele = int(input('enter coefficient {} for qx: '.format(i + 1)))
# if 'qx' is not present already, add empty list with 'qx' as key
if 'qx' not in poly:
poly['qx'] = []

# after adding empty list with 'qx' as key, append input to the list.
# I added this line because it also add 1st coefficient to the list.
poly['qx'].append(ele)

# else, append input to the list
else:
poly['qx'].append(ele)


option = input('Select Addition, Subtraction, Multiplication, Division: ')
if option.lower() == "addition":
print(numpy.polynomial.polynomial.polyadd(poly['px'], poly['qx']))
if option.lower() == "subtraction":
print(numpy.polynomial.polynomial.polysub(poly['px'], poly['qx']))
if option.lower() == "multiplication":
total = 0
for i in range(px_terms):
ans = poly['px'][i] * poly['qx'][i]
print(f"answer{i+1} = ", ans)
total += ans
print(f"total = {total}")
if option.lower() == "division":
qu, re = numpy.polynomial.polynomial.polydiv(poly['px'], poly['qx'])
print("Quotient: ", qu)
print("Remainder: ", re)

 

Expert Solution
steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
List
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning