Python MCQ Quiz Hub

MCQ Introduction to Python Section 1

Choose a topic to test your knowledge and improve your Python skills

Which of the following is not in Python Character Set.





✅ Correct Answer: 4

Which of the following is not the mode of interacting with python?





✅ Correct Answer: 3

What will be the data type of the following variable?





✅ Correct Answer: 2

Write the output of the following: print(range(0,8,2))





✅ Correct Answer: 2

Which of the following is not correct about python?





✅ Correct Answer: 4

Which of the following is not correct about python?





✅ Correct Answer: 4

Smallest element of of python coding is called ________





✅ Correct Answer: 2

Which of the following is not a token?





✅ Correct Answer: 3

Write the output of the following code: x=2 x=5 x=x+x print(x)





✅ Correct Answer: 3

Write the output of the following code : x=2 y=3 x+y+5 print(x+y)





✅ Correct Answer: 2

Which of the following symbol is used to write comment?





✅ Correct Answer: 3

Each statement in python is terminated by ___





✅ Correct Answer: 4

Write the output of the following: print(‘Hello, world!’);print(“H”)





✅ Correct Answer: 3

___ spaces should be left for indentation.





✅ Correct Answer: 2

What type of error is returned by the following statement? def abc(a): print(a)





✅ Correct Answer: 2

Which keyword is used to define a function in python?





✅ Correct Answer: 1

Write the output of the following: a=8 def abc(a): print(a) abc(7)





✅ Correct Answer: 4

Statement below “function definition” begin with spaces called ____





✅ Correct Answer: 1

Which of the following is invalid variable name? a.





✅ Correct Answer: 3

Write the output of the following. def abc(): print("abc")





✅ Correct Answer: 4

Which statement will display square of number (n)





✅ Correct Answer: 3

What type of error is returned by the following statement? print(eval(13))





✅ Correct Answer: 2

Which statement is adding remainder of 8 divided by 3 to the product of 5 and 6?





✅ Correct Answer: 1

Identify the invalid identifier. b. c. d.





✅ Correct Answer: 4

Which keyboard key is used to run python programs?





✅ Correct Answer: 2

Which method is used to find the memory location of variable?





✅ Correct Answer: 1

________________ method is used to find the data type of a variable.





✅ Correct Answer: 1

____________ escape sequence is used for horizontal tab. a. b. c. T d. No





✅ Correct Answer: 2

An escape sequence is represented by __________ slash followed by one or two characters.





✅ Correct Answer: 1

Write the output of the following code : >>> x = 4 - 7j >>> print(x.imag, x.real)





✅ Correct Answer: 2

Write the output of the following code : >>> a=9 >>> x=str(a) >>> b=5 >>> y=str(b) >>> x+y





✅ Correct Answer: 3

Write the output of the following code : >>> 7+2//1**2 > 5+2**2//3 a. b.





✅ Correct Answer: 1

Write the output of the following code : >>> s = None >>> s





✅ Correct Answer: 1

Which of the following assignment will return error?





✅ Correct Answer: 2

Which of the following is wrong in reference to naming of variable?





✅ Correct Answer: 3

Which of the following is invalid identifier?





✅ Correct Answer: 3

Identifier name can be of maximum ____________ character





✅ Correct Answer: 1

Which of the following can not be used as an identifier?





✅ Correct Answer: 3

Which of the following statement is calculating x raise to power n?





✅ Correct Answer: 2

Write the output of the following. m, n, p = 1, 2, 3 print(m, n, p)





✅ Correct Answer: 2

Which of the following is valid operator?





✅ Correct Answer: 1

Output of print(7 % 21) is ____





✅ Correct Answer: 2

Operators of same precedence are executed from _____





✅ Correct Answer: 1