Computer Science, asked by wodam19006, 5 months ago

Write a python script to ask users print all lines of a file.
Use try and except for bad inputs.
Use rstrip() to remove \n from end of each line to avoid unwanted gaps between lines.

Answers

Answered by Anonymous
2

while True:

   try:

       fname = input("Enter a file name: ")

       break

   except:

       print("Error")

       continue

fhand =open(fname)

for line in fhand:

   line = line.upper().rstrip()

   print(line)

Please Mark Brainliest

Answered by wertyuio67
0

Thank you for free points

Similar questions