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.

Quiz Topics

11 Modules

Best Practices

4 topics
1.

Code Reviews

10 questions
2.

Code Style (PEP 8)

10 questions
3.

Documentation and Comments

10 questions
4.

Version Control with Git

10 questions

Advanced Topics

5 topics

Testing and Debugging

3 topics

File Handling

4 topics

Error Handling

3 topics

Object-Oriented Programming (OOP)

5 topics

Modules and Packages

4 topics

Data Structures

5 topics

Functions

5 topics

Control Structures

4 topics

Basic Syntax and Data Types

5 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

Quiz Topics

11 Modules

Best Practices

4 topics
1.

Code Reviews

10 questions
2.

Code Style (PEP 8)

10 questions
3.

Documentation and Comments

10 questions
4.

Version Control with Git

10 questions

Advanced Topics

5 topics

Testing and Debugging

3 topics

File Handling

4 topics

Error Handling

3 topics

Object-Oriented Programming (OOP)

5 topics

Modules and Packages

4 topics

Data Structures

5 topics

Functions

5 topics

Control Structures

4 topics

Basic Syntax and Data Types

5 topics