Python Programming Test Online version The next test contain questions about the Python programming language. Please answer the following questions by Kati Altamirano Ramirez 1 The following expression 2 ** 3 ** 2 ** 1 is : a Invalid b Equal to 16 c Equal to 512 d Equal to 128.0 2 What is the expected output of the following snippet? a 500 b 72 c 250 d 125 3 What snippet would you insert in the line indicated below: a print(n, sep=" ") b print(n) c print(n, " ") d print(n, end=" ") 4 What is the value type returned after executing the following snippet? a float b bool c int d str 5 What will the final value of the Val variable be when the following snippet finishes its execution? a 1 b 0 c 2 d The code is erroneous 6 What is the expected output of the following snippet? a The code is erroneous b 1 c 3 d 2 7 Which of the following statements are true? a Python strings are immutable, which means they cannot be sliced b Lists and strings in Python can be sliced c UNICODE is the name of an operating system d Python strings are mutable, which means they can be sliced 8 What is the result of the following comparison? a The comparison causes a runtime exception/error b True c False d None 9 How many stars (*) will the following snippet send to the console? a Two b One c Four d Three 10 What is the expected output of the following snippet? a True b False c None d The program will cause a runtime exception/error 11 What is the expected behavior of the following snippet? a print 5 b print 1 c print 3 d The code will cause a runtime exception/error 12 What is the expected behavior of the following code snippet? a The program will generate a sequence of ten (pseudo)random integers from 1 to 5 b The program will cause a runtime exception/error c The result cannot be predicted d The program will generate a sequence of ten (pseudo)random numbers from 1 to 5 13 What is the expected behavior of the following snippet? a print hello b cause a runtime exception on line 3 c cause a runtime exception on line 4 d cause a runtime exception on line 5 14 Select the true statements: a Positional arguments are also called keyword arguments b The order of arguments matters when they are passed positionally c The order of arguments matters when they are passed by their name 15 The following class hierarchy is given. What is the expected output of the code? a ABB b AB c BA d AAA 16 If the following snippet is executed and the exception is raised a one non-empty line and one empty line b two empty lines c two different non-empty lines d two identical non-empty lines 17 What is the expected output of the following snippet? a [2, 4] b ['C', 2, 4] c ['A', 'B'] d ['B', 'C', 2, 4] 18 What is the expected behavior of the following snippet? a It will print: SPAMMAPS b It will print: None c It will print an empty line d It will print: SPAM MAPS 19 What is the expected behavior of the following snippet? a print 256 b print 64 c print 512 d The code will cause a runtime exception/error 20 If you want to build a string that reads a "Peter's sister's name's \"Anna\"" b 'Peter\'s sister\ 's name\ 's \" Anna\ c "Peter's sister's name's "Anna"" d 'Peter's sister's name's "Anna" '