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