Question: Problem Description and Given Info You must alter the program that you are given below in Python. The program you are given will open the

Problem Description and Given Info
You must alter the program that you are given below in Python.
The program you are given will open the file named "jabberwocky.txt", and display the contents of that file to the console.
You must change the code, so that the program will open the file named "crocodile.txt", and display the contents of that file to the console.
make no other changes to the code, and make no changes to any of the provided .txt files.
Be sure that you carefully read the given code and understand how it works.
lab activity
22.8.1: Read File 01 Individual Challenge
0/10
main.py
Load default template...
1
2
3
4
5
6
7
my_file = open('jabberwocky.txt') # open the file
for line in my_file: # iterate through the lines in the file
line = line.rstrip() # remove the newline from the end of each line
print(line) # outut the line
my_file.close() # close the file

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 Programming Questions!