File Input and Output Exercises for Student Teacher Transition
In this collection of exercises, students transitioning from student to teacher roles explore file input and output concepts. The content covers adapted exercises from LPTHW, CodeCademy tasks, and practical assignments for the upcoming week. From opening and writing to manipulating text files, participants will enhance their skills in loops, print statements, and more. The emphasis is on hands-on practice to deepen understanding and mastery of file handling in programming.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Lecture 7 Student becomes Teacher File Input and Output
CodeCademy 6: Student becomes Teacher
CodeCademy 12: File Input and Output Problem: you need to refresh the text.txt file.
Adapted exercises from LPTHW Ex. 15,16 and 17 Originals take parameters to give the names of files. We just provide them with raw_input. 4
Anyone ? 5
Note : My_file = open( text.txt , a ) will open the file, so that .write( ) will append My_file = open( text.txt , w ) will actually also open a not-yet existing file 6
Assignment for next week: CodeCademy 8.a: Loops (24 min.) Exercise from LPTHW: ex.33 (7 min.), ex. 35 (use cut-and-past on the print statements (20 min.), ex.38 (skip the long introduction) (15 min.) 7
Exercises of next week: CodeCademy 8.b: Practice makes perfect. Long list of small rehearsal exercises. 8