Python Test 1 - Core Data types Which of these in not a core data type? Tuples Class Lists Dictionary Given a function that does not return any value, What value is thrown by default when executed in shell. void bool int None What will be the output of the following Python code? str="hello" str[:2] he hello olleh lo Which of the following will run without errors? round(7463.123,2,1) round(6352.898,2,5) round() round(45.8) What is the return type of function id? dict int bool float In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed. x = 13 ? 2 objective is to make sure x has a integer value, select all that apply (python 3.xx) x = 13 // 2 x = 13 % 2 x = int(13 / 2) All of the mentioned What error occurs when you execute the following Python code snippet? apple = mango ValueError TypeError NameError SyntaxError What will be the output of the following Python code snippet? def example(a): a = a + '2' a = a*2 return a example("hello") indentation Error hello2 cannot perform mathematical operation on strings hello2hello2 What data type is the object below? L = [1, 23, 'hello', 1] tuple dictionary list array In order to store values in terms of key and value we use what core data type. dictionary tuple list class Which of the following results in a SyntaxError? “He said, ‘Yes!'” ‘3\’ ”’That’s okay”’ ‘”Once upon a time…”, she said.’ What is the average value of the following Python code snippet? grade1 = 80 grade2 = 90 average = (grade1 + grade2) / 2 85.0 95.1 95.0 85.1 Select all options that print. hello-how-are-you print(‘hello’, ‘how’, ‘are’, ‘you’) print(‘hello’, ‘how’, ‘are’, ‘you’ + ‘-‘ * 4) print(‘hello’ + ‘-‘ + ‘how’ + ‘-‘ + ‘are’ + ‘you’) print(‘hello-‘ + ‘how-are-you’) What is the return value of trunc()? int float bool None Schreibe einen Kommentar Antworten abbrechenDu musst angemeldet sein, um einen Kommentar abzugeben.