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