
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
please use python for this code and follow the instructions in the photo please!
![Write a program that takes a sequence of non-negative numbers and performs
the computation suggested by these examples. A negative number is used to
terminate the input but is not part of the sequence.
Restrictions: The only list operations you are allowed to use on this exam
are as follows:
Length of a list:
List accessor:
len(list)
list[k]
Create empty list: list = [ ]
list.append(k)
List append:
Examples :
computation
1*5 + 2*4 + 3*3 + 4*2 + 5*1
3*9 + 5*6 + 6*5+ 9*3
3*2 + 8*8 + 2*3
input
output
2 3 4 5 -1
35
3 5 6 9 -1
114
3 8 2 -1
76
7 -1
7*7
49
|| || ||||](https://content.bartleby.com/qna-images/question/601ccad1-4d17-4947-9a80-69495cb62ebb/775e298b-4186-4fe3-bd5c-86a581e2a646/hdtcx1k_thumbnail.png)
Transcribed Image Text:Write a program that takes a sequence of non-negative numbers and performs
the computation suggested by these examples. A negative number is used to
terminate the input but is not part of the sequence.
Restrictions: The only list operations you are allowed to use on this exam
are as follows:
Length of a list:
List accessor:
len(list)
list[k]
Create empty list: list = [ ]
list.append(k)
List append:
Examples :
computation
1*5 + 2*4 + 3*3 + 4*2 + 5*1
3*9 + 5*6 + 6*5+ 9*3
3*2 + 8*8 + 2*3
input
output
2 3 4 5 -1
35
3 5 6 9 -1
114
3 8 2 -1
76
7 -1
7*7
49
|| || ||||
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 2 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.Similar questions
- using python language Using the piece of code on the previous slide, modify the code removing the x += 1 portion and run the code. What happens? Now modify the code to print the numbers but in reverse order Lastly, modify the code to print the numbers 1 through 10 which are not divisible by 3arrow_forwardAny help with this question is greatly appreciated!! Please include screenshots of the code if possible. Thank you!! This is my last question, if possible could I have help with the five sub parts? I know it is usually only 3 sub parts. It would really mean a lot! Thank you!! 1. For this question please write a python coded program for each concept displaying how each one is done. Create it any way you would like and explain your code. -read a file and put some content into a variables-how to create a list of strings-printing the list of strings-how to sort list-select middle few in list to make another listarrow_forwardNeed help in writing the code in Python!arrow_forward
- General Requirements Create a folder named with your surname followed by 2 (example smith2). In this folder, write Python programs to solve the problems described below. Use the suggested names for your programs. Start each program with your name and SPC ID# in a comment. See page 39 for how to write comments. Plan the steps for each program by writing pseudocode at the beginning of your program. See page 34. Write your pseudocode as comments immediately after your name and SPC ID#. Good pseudocode is required for full points. Add more comments in each program to explain what your code is doing. Do not go your own way by writing a program that ignores the requirements. Solve the problem as the requirements specify. Where formatted numbers are required in output, use f-strings as on pages 70-78. When done, you have to zip/compress your folder for submitting. Do this by right-clicking on your folder and selecting "Send to" > "Compressed (zipped) folder". This will make a zip…arrow_forwardI multiple times told you experts, don't use AI and other's work otherwise I'll report and reduce your rating very sure. I'll take serious action.arrow_forwardTo draw a circle by specifying a center point and radius or diameter Do one of the following: Click draw-circle-center-point. Click draw-circle-center-arc. aut cad You can place any menu or menu bar on the main screen of the AutoCAD program by one of the following methods:- False True * aut cad From the file From the tool menu. From the tool menu, then the toolbar, and then select AUTCAD. From the any menu From the toolbararrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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