1) Given the following Python code, what will the data type of pet be? pet = \"G
ID: 666162 • Letter: 1
Question
1) Given the following Python code, what will the data type of pet be? pet = "Gordon", "Gecko", 3T/F
2) The following statement can cause an exception: names_file = open('names.txt', 'r')
3) A file object's writelines method automatically writes a newline (' ') after writing each list item to the file.
4) The else suite in a try/except statement executes only if a statement in the try suite raises an exception.
1) Given the following Python code, what will the data type of pet be? pet = "Gordon", "Gecko", 3
T/F
2) The following statement can cause an exception: names_file = open('names.txt', 'r')
3) A file object's writelines method automatically writes a newline (' ') after writing each list item to the file.
4) The else suite in a try/except statement executes only if a statement in the try suite raises an exception.
1) Given the following Python code, what will the data type of pet be? pet = "Gordon", "Gecko", 3
T/F
2) The following statement can cause an exception: names_file = open('names.txt', 'r')
3) A file object's writelines method automatically writes a newline (' ') after writing each list item to the file.
4) The else suite in a try/except statement executes only if a statement in the try suite raises an exception.
1) Given the following Python code, what will the data type of pet be? pet = "Gordon", "Gecko", 3
T/F
2) The following statement can cause an exception: names_file = open('names.txt', 'r')
3) A file object's writelines method automatically writes a newline (' ') after writing each list item to the file.
4) The else suite in a try/except statement executes only if a statement in the try suite raises an exception.
Explanation / Answer
1)tuple
2) True beacause file names.txt may not be present it may cause exception
3)True
4)false if there is no exception then else is executed
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.