Write Python Codes for the following: Get 2 inputs from the user and perform division using these
Fantastic news! We've Found the answer you've been seeking!
Question:
Write Python Codes for the following:
Transcribed Image Text:
Get 2 inputs from the user and perform division using these numbers and handle ZeroDivisionError, ValueError, and NameError by printing related errors. (2 points) 2. Define a class with one method that sorts the elements in the list in descending order, and another method that sorts in ascending order. Print the sorted elements of the list [15, 21, 11, 14, 32, 67] by creating an object of your class and calling the respective methods (2 points) 3. Look at the python script given in the link below school info.py and list the number of classes and name of the functions (without the constructor) along with its arguments in each class as a comment in the .ipynb file (4 points) 4. Draw a diagram to show the hierarchy of the classes in the file school info.py, and submit the answer as a .docx or .pdf file (3 points) 5. Make a class with a constructor that takes a list as input and calculates the sum of all the values in the list. Instantiate this class by passing a list with 10 integers. Add a breakpoint inside the constructor such that the interactive console of PDB can be used to look at the values of the addition after each item in the list is calculated. No need to post if you used the PDB console or not (3 points). Get 2 inputs from the user and perform division using these numbers and handle ZeroDivisionError, ValueError, and NameError by printing related errors. (2 points) 2. Define a class with one method that sorts the elements in the list in descending order, and another method that sorts in ascending order. Print the sorted elements of the list [15, 21, 11, 14, 32, 67] by creating an object of your class and calling the respective methods (2 points) 3. Look at the python script given in the link below school info.py and list the number of classes and name of the functions (without the constructor) along with its arguments in each class as a comment in the .ipynb file (4 points) 4. Draw a diagram to show the hierarchy of the classes in the file school info.py, and submit the answer as a .docx or .pdf file (3 points) 5. Make a class with a constructor that takes a list as input and calculates the sum of all the values in the list. Instantiate this class by passing a list with 10 integers. Add a breakpoint inside the constructor such that the interactive console of PDB can be used to look at the values of the addition after each item in the list is calculated. No need to post if you used the PDB console or not (3 points).
Expert Answer:
Answer rating: 100% (QA)
Here are Python code snippets to address each of your points Get 2 inputs from the user and perform ... View the full answer
Related Book For
Systems Analysis and Design
ISBN: 978-1305494602
11th Edition
Authors: Scott Tilley, Harry J. Rosenblatt
Posted Date:
Students also viewed these programming questions
-
What are the mechanisms underlying nuclear reprogramming and cellular differentiation, and how are they controlled within the nucleus?
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
How do business plan for successful import and export activity?
-
A baseball pitching machine ??throws?? baseballs with a horizontal velocity v0 . Knowing that height h varies between 788 mm and 1068 mm, determine (a) The range of values of v0, (b) The values of ...
-
In Example 7.53 we mentioned three ways to make the need for comparisons more explicit when defining a generic sort routine in C++: make the comparison routine a method of the generic parameter class...
-
Organizations have traditionally used employee time saved as the primary source of benefits to justify HRIS and other types of information system investments. Why can this be problematic? Give...
-
Helena Corporation operates three investment centers. The following financial statements apply to the investment center named Bowman Division: BOWMAN DIVISION Income Statement For the Year Ended...
-
Write an HTML document that draws the trapezoid (a rectangle that is wider on one side) below in Canvas. (30,30) 50 50 70
-
The partnership of Bramble, Sunland, and Coronado engaged you to adjust its accounting records and convert them uniformly to the accrual basis in anticipation of admitting Kerns as a new partner....
-
The fiscal year for both companies ends December 31. The lease agreement specified quarterly payments of $3,700 beginning September 30, 2024, the beginning of the lease, and each quarter (December...
-
Eve Co purchases a machine that had a list price of $10,000 on January 1, 2020 The machine has no estimated residual value and a 2 years estimated useful life. The Company is using the...
-
On May 20, the board of directors for Auction.com declared a cash dividend of 50 cents per share payable to stockholders of record on June 14. The dividends are paid on July 14. The company has...
-
a. The company has one truck that it purchased at the start of this year. The truck cost $75,000, had an estimated useful life of five years and is expected to have zero value at the end of the five...
-
Yaro Company owns 30% of the common stock of Dew Co. and uses the equity method to account for the investment. During 2011, Dew reported income of $250,000 and paid dividends of $80,000. There is no...
-
What is the primary accounting difference between accounting for when the subsidiary is dissolved and when the subsidiary retains its incorporation?
-
a. What is the rate law for the uncatalyzed reaction? a. rm rate={it k}[Ce^{4+}]^2[Tl^+] b. rm rate={it k}[Ce^{4+}][Tl^+] c. rm rate={it k}[Ce^{4+}] d. rm rate={it...
-
For the following exercises, find the inverse of the function and graph both the function and its inverse. f(x) = 4 x 2 , x 0
-
Review Section 8.4.1 and the accompanying text about EHR usability. Research the current status of EHR usability, and describe all noteworthy developments.
-
Perform research on the Web to learn more about RSS feeds. Then write a practical, step-by-step guide for users who want to set up RSS feeds at their workstations.
-
Think of all the tasks that you perform when you purchase a car. Include any research, decisions, or financial issues that relate to the purchase. Draw a Gantt chart that shows all the tasks and the...
-
Do the assumptions for Bernoulli trials appear to hold? Explain. If the assumptions hold, identify success and the probability of interest. (a) A TV ratings company will use their electronic...
-
Use Table 1, or software, to find (a) \(B(7 ; 18,0.45)\); (b) \(b(7 ; 18,0.45)\); (c) \(B(8 ; 11,0.95)\); (d) \(b(8 ; 11,0.95)\); (e) \(\sum_{k=4}^{11} b(k ; 11,0.35)\); (f) \(\sum_{k=2}^{4} b(k ;...
-
Which conditions for the binomial distribution, if any, fail to hold in the following situations? (a) The number of persons having a cold at a family reunion attended by 30 persons. (b) Among 8...
Study smarter with the SolutionInn App