#chapter 7 exers - from book

opn = input('Enter file name to open: ')
try :
    fle = open(opn)
except :
    print('File cannot be opened / does not exist.')
    quit()

for line in fle :
    line = line.rstrip()
    print(line.upper())
    if line.endswith('-0500') : break

fed86f76b056b8b095dee4667c91139710e3d9f6
<mask token>

<mask token>
try:
    fle = open(opn)
except:
    print('File cannot be opened / does not exist.')
    quit()
for line in fle:
    line = line.rstrip()
    print(line.upper())
    if line.endswith('-0500'):
        break

opn = input('Enter file name to open: ')
try:
    fle = open(opn)
except:
    print('File cannot be opened / does not exist.')
    quit()
for line in fle:
    line = line.rstrip()
    print(line.upper())
    if line.endswith('-0500'):
        break

#chapter 7 exers - from book

opn = input('Enter file name to open: ')
try :
    fle = open(opn)
except :
    print('File cannot be opened / does not exist.')
    quit()

for line in fle :
    line = line.rstrip()
    print(line.upper())
    if line.endswith('-0500') : break
