Search Header Logo

Python Indentation and PEP 8 Quiz

Authored by Adham Elmuntser

Computers

1st Grade

Used 1+ times

Python Indentation and PEP 8 Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the maximum recommended line length in Python according to PEP 8?

50 characters

79 characters

100 characters

120 characters

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does consistent indentation help with in Python code?

Making the code colorful

Improving readability

Adding more functions

Increasing execution speed

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an example of a bad indentation practice?

Using 4 spaces

Using inconsistent spaces

Using comments

Using functions

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why should lines be limited to 79 characters in Python?

To make the code colorful

To improve readability

To add more comments

To increase speed

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an example of a good indentation practice?

Using 2 spaces

Using 4 spaces

Using tabs

Using no spaces

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How should imports be organized in code?

On separate lines

All on one line

In random order

Without any order

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the naming convention for variable and function names?

CamelCase

snake_case

UPPERCASE

lowercase

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?