Vidyalelo
Python · all questions

Python Introduction and basic
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

81

Questions

2/5

Page

Pick an option on a question to see the right answer and solution.

What does the return statement do in a function?

Select an option to see the answer and solution.

What is the purpose of a module in Python?

Select an option to see the answer and solution.

Which of the following is a valid way to handle errors in Python?

Select an option to see the answer and solution.

What is the purpose of the try and except blocks in Python?

Select an option to see the answer and solution.

What is the role of the import statement in Python?

Select an option to see the answer and solution.

What is the purpose of an if-statement in Python?

Select an option to see the answer and solution.

Which of these is the definition for packages in Python?

Select an option to see the answer and solution.

What is the output of print("Hello, " + "world!")?

Select an option to see the answer and solution.

What does the range() function in Python generate?

Select an option to see the answer and solution.

What is the output of print("Hello, World!")?

Select an option to see the answer and solution.

What will be the value of the following Python expression?
4 + 3 % 5

Select an option to see the answer and solution.

Python supports the creation of anonymous functions at runtime, using a construct called . . . . . . . .

Select an option to see the answer and solution.

What is the order of precedence in python?

Select an option to see the answer and solution.

What does pip stand for python?

Select an option to see the answer and solution.

Which of the following is true for variable names in Python?

Select an option to see the answer and solution.

Which of the following functions is a built-in function in python?

Select an option to see the answer and solution.

Which of the following is the use of id() function in python?

Select an option to see the answer and solution.

Which one of the following is the use of function in python?

Select an option to see the answer and solution.

Which of the following functions can help us to find the version of python that we are currently working on?

Select an option to see the answer and solution.

What will be the output of the following Python program?
i = 0
while i < 5:
    print(i)
    i += 1
    if i == 3:
        break
else:
    print(0)

Select an option to see the answer and solution.