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