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")

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
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")

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
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
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
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
Bartleby Expert
SEE SOLUTION
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY