Computer Science - Text-Based Programming - Python - File handling (read/write) - File Operations Practice
P1: 'Open file for reading' → with open('data.txt', '___') as f: [r]. P2: 'Write list to file, one item per line' → for item in my_list: f.write(___ + '\\n') [str(item)]. P3: 'Read all lines into a list' → lines = f.___() [readlines]. P4: 'Count lines in a file' → with open('file.txt') as f: count =