- You need to create a Python repl
- Create the text file 'file1.txt' on your computer, and fill it with some lines of text
- Upload the text file by dragging it from your file manager into the files area in your repl
- Include the code in your question in main.py
- Run your program!
Try getting it working yourself, then compare it to this repl: https://replit.com/@malvoliothegood/readtextfile#main.py