Question: [ ] # Download Colab Notebook as . pdf and . ipynb Instructions from IPython.display import HTML HTML ( n height =

[] # Download Colab Notebook as .pdf and .ipynb Instructions
from IPython.display import HTML
HTML("n"
height="950" width="1950" style="border: 1px solid #464646;" allowfullscreen allow="autoplay" aria-label="Panopto Embedded Video Player">
n"n)
Q1: Write a Python program that prompts user for five grocery items (e.g. apples, flour, oranges, etc.) For each item, the program must ask the
user its corresponding price. The items and their prices are written into a file. Please include your code and your text file generated by the
program in the screenshots.
[]
def main():
''' YOUR CODE HERE '''
main()
For this question you will first need to create a text file with the data given below using notepad
or any other text editor. Save the file as data.txt.
Q1: Create a text file with the data given below using notepad or any other editor. Save the file as data .txt. Write a program that will open the file
and read the age of each individual and their name and display it on the command prompt. After reading the entire file, the program must also
output the total sum of ages included in the file.
John Adams 25
Patrick Henry 30
Thomas Jefferson 19
George Washington 28
Alexander Hamilton 15
[]
def main():
''') YOUR CODE HERE '`'
main()
[ ] # Download Colab Notebook as . pdf and .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!