Copy of ITSC 1212 Lab Implementation Portfolio (6)

pdf

School

University of North Carolina, Charlotte *

*We aren’t endorsed by this school

Course

1212

Subject

English

Date

Apr 3, 2024

Type

pdf

Pages

8

Uploaded by BaronPelicanPerson1070

Report
ITSC 1212 Lab Portfolio Context - Module Title and Objectives Module 8 - File I/O Explain the structure of file systems Describe the different modes for opening files Demonstrate assigning values to variables by reading from a file Demonstrate writing text files in Python Problem description The problem requires completing a Python program, named lab8_p3.py, to store the contents of a list called 'months' into a text file named 'months.txt'. Each month from the list should be stored on a separate line in the text file. Essentially, the program needs to write the elements of the 'months' list into the 'months.txt' file with each month on a new line
ITSC 1212 Lab Portfolio Solution Explain the steps you have taken or tried to arrive at the final, polished solution. What did you get stuck on? How did you get unstuck? Design Flowchart - Representation of solution
ITSC 1212 Lab Portfolio
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
ITSC 1212 Lab Portfolio Implemented Solution Add a screenshot of the implemented solution (code/program) Program
ITSC 1212 Lab Portfolio Verification / Evidence that it works What things did you try to ensure your solution works as intended? If you implemented a program did you use the program visualizer or created environment diagrams. Make connections between your process and the learning objectives for this week. Before starting the implementation, I reviewed my understanding of file systems, including the hierarchical structure of directories and files. This understanding helped me plan where the output file should be located and how it should be named. I made sure to understand the different modes for opening files in Python, such as "r" for reading, "w" for writing, and "a" for appending. Since the task required writing to a file, I chose the "w" mode to open the file for writing, which would create a new file if it doesn't exist or overwrite the existing one. I wrote the code to take the provided list of months and then iterate over each month, writing it to the file with a newline character ("\n") after each month. This process followed the logic of file writing in Python. After writing the code, I tested it with different inputs and scenarios to ensure that it correctly writes the months to the file as expected. I checked whether the file was created and whether its contents matched the expected output. By following these steps, I ensured that my solution aligned with the learning objectives for this week's topic on File I/O, covering the understanding of file systems, file opening modes, variable assignment from file reading, and writing text files in Python.
ITSC 1212 Lab Portfolio Execution sample
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
ITSC 1212 Lab Portfolio Human Credits Have you collaborated with another human on this assignment? [ ] Yes [ X ] No If your answer is “Yes”, please provide details on how this collaboration contributed to your learning experience.
ITSC 1212 Lab Portfolio AI Credits Have you used an AI-powered tool or application to assist you with this assignment? [ ] Yes [ X ] No If your answer is “Yes”, please provide details on how the AI tool contributed to your learning experience. Feel free to include screenshots of your collaboration with AI.