
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
PYTHON help- Beginner
program6_2.py
This program reads the text file created in the program 6_1 and displays its data. Use f-strings to create a table with a row for each item and the columns as shown below. $ signs are not required. Choose your own column widths but include column headings as shown.
Here is my program6_1
f = open('data.txt', 'w')
while(True):
name = input("Enter item name or Enter to quit ")
if name == "" :
break
cost = input("Enter item's regular price ")
reduction = input("Enter reduction percent for sale ")
f.write(name + ' ' + cost + ' ' + reduction + ' \n')
f.close()
print(f"File was created")

Transcribed Image Text:ITEM
REG. PRICE
REDUCED
SALE PRICE
laptop
899.99
225.00
674.99
router
229.95
91.98
137.97
printer
monitor
399.99
80.00
319.99
425.79
127.74
298.05
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 nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Transcribed Image Text:2
of 4
Automatic Zoom
View as Text
Download
>>
LAB ASSIGNMENTS
IMPORTANT: you should complete the PDP thinking process for
each program. Turn in items:
1) book_list.py: you can adapt your Chapter 4 book_list.py Lab
program. The program summarizes costs of a book list.
It uses all of our standard mipo_ex features.
This program summarizes a book list.
Enter the number of books that you need:
In this version of the program you must use pylnputPlus
functions to perform all the input validation and for the main()
loop decision.
Please enter a whole number: three
Enter a number greater than 0: 3
Enter the name of book #1: The Mueller Report
Enter cost of The Mueller Report, to the nearest dollar:
Please enter a whole number: 18
Enter the name of book #2: Educated: A Memoir
Enter cost of Educated: A Memoir, to the nearest dollar:
Please enter a whole number: 24
08
Adjust your program to allow book prices to include $ and
cents. Restrict individual book prices to $100 maxium.
Enter the name of book #3: Becoming
Enter cost of Becoming, to the nearest dollar:
Please enter a whole number: 12
Info on 3 Books Needed
Books
The Mueller Report
Educated: A Memoir
Clearly document, with comments, your use of the pyip
Price
functions.
18.00
24.00
Becoming
12.00
Total
54.00
Average
Need more books? Enter y or n:
18.00
Solution
by Bartleby Expert
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Transcribed Image Text:2
of 4
Automatic Zoom
View as Text
Download
>>
LAB ASSIGNMENTS
IMPORTANT: you should complete the PDP thinking process for
each program. Turn in items:
1) book_list.py: you can adapt your Chapter 4 book_list.py Lab
program. The program summarizes costs of a book list.
It uses all of our standard mipo_ex features.
This program summarizes a book list.
Enter the number of books that you need:
In this version of the program you must use pylnputPlus
functions to perform all the input validation and for the main()
loop decision.
Please enter a whole number: three
Enter a number greater than 0: 3
Enter the name of book #1: The Mueller Report
Enter cost of The Mueller Report, to the nearest dollar:
Please enter a whole number: 18
Enter the name of book #2: Educated: A Memoir
Enter cost of Educated: A Memoir, to the nearest dollar:
Please enter a whole number: 24
08
Adjust your program to allow book prices to include $ and
cents. Restrict individual book prices to $100 maxium.
Enter the name of book #3: Becoming
Enter cost of Becoming, to the nearest dollar:
Please enter a whole number: 12
Info on 3 Books Needed
Books
The Mueller Report
Educated: A Memoir
Clearly document, with comments, your use of the pyip
Price
functions.
18.00
24.00
Becoming
12.00
Total
54.00
Average
Need more books? Enter y or n:
18.00
Solution
by Bartleby Expert
Knowledge Booster
Similar questions
- python LAB: Subtracting list elements from max When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. Write a program that adjusts a list of values by subtracting each value from the maximum value in the list. The input begins with an integer indicating the number of integers that follow.arrow_forward1c) Average sentence length We will create a function ( avg_sentence_len ) to calculate the average sentence length across a piece of text. This function should take text as an input parameter. Within this function: 1. sentences : Use the split() string method to split the input text at every '.'. This will split the text into a list of sentences. Store this in the variable sentences . To keep things simple, we will consider every "." as a sentence separator. (This decision could lead to misleading answers. For example, "Hello Dr. Jacob." is actually a single sentence, but our function will consider this 2 separate sentences). 2. words : Use the split() method to split the input text into a list of separate words, storing this in words . Again, to limit complexity, we will assume that all words are separated by a single space (" "). (So, while "I am going.to see you later" actually has 7 words, since there is no space after the ".", so we will assume the this to contain 6 separate…arrow_forwardPythonarrow_forward
- PYTHON Complete the function below, which takes two arguments: data: a list of tweets search_words: a list of search phrases The function should, for each tweet in data, check whether that tweet uses any of the words in the list search_words. If it does, we keep the tweet. If it does not, we ignore the tweet. data = ['ZOOM earnings for Q1 are up 5%', 'Subscriptions at ZOOM have risen to all-time highs, boosting sales', "Got a new Mazda, ZOOM ZOOM Y'ALL!", 'I hate getting up at 8am FOR A STUPID ZOOM MEETING', 'ZOOM execs hint at a decline in earnings following a capital expansion program'] Hint: Consider the example_function below. It takes a list of numbers in numbers and keeps only those that appear in search_numbers. def example_function(numbers, search_numbers): keep = [] for number in numbers: if number in search_numbers(): keep.append(number) return keep def search_words(data, search_words):arrow_forwardC++ beginners.arrow_forwardi need to add the loop with the lists to my code can you help. see code and the part that i need to add.arrow_forward
- Help me on below python program.arrow_forwardCommand Program Create a program that allows you to view and edit the sales amounts for each month of the current year. This program is required to use commands add, view, totals, edit, and exit. The program should use a list to store the sales data for each month with the three-letter abbreviation for the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec) to use as the key for each item. When the program starts, it should read the sales data inserted from the user. If the user edits the sales data, the program should edit the data If the user selects total, then the program should calculate the total sales and average monthly sales. Use functions to view sales, edit sales, calculate total, and calculate average. Please use all commands, and thank you in advance.arrow_forwardIn c++ languagearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY