Python Programming Language

402 questions in the bank
Are you ready to take quiz?
Explore more
Logo
About the Quiz

Quiz will ask 20 randomly selected questions with allotted time of . You can take the quiz more than once. Once you submit the quiz, you can review how you have done, the correct the answers for each questions and the explanation for the correct the answer.

INR100.00
INR1000.00
Unlimited Attempts   (lifetime access)

Try your first attempt for free.

Quiz Topics

11 Modules

Basic Syntax and Data Types

5 topics
1.

Comments and Docstrings

10 questions
2.

Data Types (int, float, str, bool)

18 questions
3.

String Formatting

18 questions
4.

Type Conversion

10 questions
5.

Variables and Constants

10 questions

Control Structures

4 topics

Functions

5 topics

Data Structures

5 topics

Modules and Packages

4 topics

Object-Oriented Programming (OOP)

5 topics

Error Handling

3 topics

File Handling

4 topics

Testing and Debugging

3 topics

Advanced Topics

5 topics

Best Practices

4 topics
Sample questions

Which of the following are true about Python's docstrings?

They are used to document functions, classes, and modules.

They can be accessed using the __doc__ attribute.

They must be written in single quotes.

They can span multiple lines.

What will be the output of the following code?

def my_function():
    '''This is a docstring.''' 
    return 42

print(my_function.`__doc__`)

This is a docstring.

None

Error

42

Which of the following are immutable data types in Python?

list

tuple

dict

str

What will be the type of the variable 'result' after executing the following code?

result = 10 + 5.5

int

float

str

bool

What will be the output of the following code?

x = '5'
y = 2
result = x + y
print(result)

7

52

TypeError

5

INR100.00
INR1000.00
Unlimited Attempts   (lifetime access)

Try your first attempt for free

Signup to add this to cart.

Quiz Topics

11 Modules

Basic Syntax and Data Types

5 topics
1.

Comments and Docstrings

10 questions
2.

Data Types (int, float, str, bool)

18 questions
3.

String Formatting

18 questions
4.

Type Conversion

10 questions
5.

Variables and Constants

10 questions

Control Structures

4 topics

Functions

5 topics

Data Structures

5 topics

Modules and Packages

4 topics

Object-Oriented Programming (OOP)

5 topics

Error Handling

3 topics

File Handling

4 topics

Testing and Debugging

3 topics

Advanced Topics

5 topics

Best Practices

4 topics