CBSE Class 12 Python Revision & Practice Hub Welcome to the Python Quiz (Class 12).Time is up! Your quiz has been submitted automatically. Thank you for participating.Quiz CBSE PREVIOUS YEAR MCQ Please continue and access the quiz. Basic Data Types, Operators, Input / Output 1 / 50What is the result of ’10’ + ’20’? 1020 10 + 20 Error 30 2 / 50Which data type is immutable? dict tuple list set 3 / 50What is the output of print(type(1/2))? Error 4 / 50Which logical operator returns True if at least one condition is true? xor and not or 5 / 50How do you write a multi-line comment string in Python? ''' ''' // /* */ 6 / 50Which method adds an element to the end of a list? insert() append() add() push() 7 / 50Which function gives the unique memory address of an object? addr() ref() mem() id() 8 / 50Which operator is used for addition in Python? / + – * 9 / 50Which logical operator returns True only if both conditions are true? and if or not 10 / 50Which escape character represents a new line? t / b n 11 / 50Which brackets are used to define a tuple? {} () [] 12 / 50Which function is used to take input from the user? get() input() read() scan() 13 / 50How do you access the value associated with key ‘k’ in dict d? d->k d['k'] d('k') d.k 14 / 50What is the output of bool(1)? Error None False True 15 / 50What is the output of bool(0)? Error None True False 16 / 50What is the output of 5 + 2 * 3? 13 21 11 15 17 / 50What is the output of 2 ** 3? 6 8 9 5 18 / 50What is the file extension for Python files? .py .pt .python .pi 19 / 50What is the output of print(10 // 3)? 3.33 3 4 3.0 20 / 50What is int(3.9)? 3.9 3 4 Error 21 / 50Python is a ______ typed language. Non Statically Dynamically Weakly 22 / 50Which logical operator reverses the boolean result? reverse ! not invert 23 / 50Which operator checks if two variables point to the same object in memory? in == equal is 24 / 50Which operator checks if two values are equal? = == != 25 / 50What happens if you use a Python keyword as a variable name? It works fine Warning SyntaxError Variable is created hidden 26 / 50Which operator checks if a value exists inside a list? find exists in has 27 / 50Which symbol is used to assign a value to a variable? == -> = : 28 / 50Which keyword is used to define a function? function define func def 29 / 50What sequence does range(3) generate? 1, 2, 3 1, 2 0, 1, 2 0, 1, 2, 3 30 / 50Which parameter in print() changes the separator between arguments? break split sep end 31 / 50Which of these is an INVALID variable name? var1 _var 1var my_var 32 / 50What is the output of len(‘Python’)? 4 7 6 5 33 / 50What is the result of 3 * ‘A’? 3A AAA A3 Error 34 / 50Which operator returns the remainder of a division? ** // % / 35 / 50Which brackets are used to define a list? () [] {} 36 / 50Which parameter in print() prevents a new line at the end? sep end stop line 37 / 50Which operator represents ‘not equal to’? == != not 38 / 50If s = ‘Python’, what is s[0]? P 0 n y 39 / 50Is Python case-sensitive? Only for strings No Sometimes Yes 40 / 50Which of these is a valid boolean value in Python? True yes true TRUE 41 / 50Which symbol is used for single-line comments? # // — /* 42 / 50If s = ‘Python’, what is s[-1]? P o n Error 43 / 50What is the return type of the input() function? bool int float str 44 / 50How do you start a formatted string (f-string)? fmt f r str 45 / 50Which of these is a complex number in Python? 5i 5j complex(5) 5c 46 / 50Which brackets are used to define a dictionary? {} || () [] 47 / 50How do you convert the integer 5 to a float? int(5) 5.0() str(5) float(5) 48 / 50Which function is used to output text to the console? write() print() echo() out() 49 / 50Which function returns the data type of a variable? typeof() check() type() id() 50 / 50Which data type stores decimal values? str bool float int Your score isThe average score is 44% LinkedIn Facebook 0% π Click here for Python Book Next Chapter β
Comments are closed.