C859 Python Questions With Complete Solutions
f1 = open("/my_path/my_", "r") correct answer: to open and read a file f1 = open("/my_path/my_", "w") correct answer: to open and write a file (all previous material discarded) f1 = open("/my_path/my_", "a") correct answer: to open and add to a file () correct answer: read a file into a string ("hello!") correct answer: writes to a file ine() correct answer: reads next line () correct answer: closes a file (must always close a file!) with open("/my_file...etc) as f: correct answer: opens, allows work, and automatically closes a file timedelta correct answer: time library function to calculate time amounts from datetime import timedelta correct answer: grabs timedelta from the datetime library
Written for
- Institution
-
Western Governers University
- Course
-
WGU C859
Document information
- Uploaded on
- July 12, 2023
- Number of pages
- 6
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
c859 python questions with complete solutions
Also available in package deal