Exercise 07 - 01 open and Read file


write a function to open and read file

fh = open('Ex_07_01/mbox.txt')
print(fh)

for line in fh:
    ly = line.rstrip()
    print (line.upper())

When you use vscode you should specify the folder before going to file

rstrip() use for open file without space by new line or open file with the exact same in original file

upper() use to open file with upper character all character in file will be capital letters

Notes mentioning this note


ນີ້ຄືກຣາຟທີ່ລິ້ງໄປຫາທຸກໜ້າໃນ garden ນີ້ 🕸️.