wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Programming Concepts Lesson 2.1 to 2.9

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is Karel in the context of Python programming?

a)

A programming language

b)

A dog who listens to commands

c)

A debugging tool

d)

A text editor

2.

Which of the following best defines debugging?

a)

Writing new program features

b)

Creating documentation

c)

The process of finding and fixing errors in programs

d)

Teaching Karel new commands

3.

What is a requirement when writing Karel commands?

a)

Include spaces between words

b)

End each command with brackets []

c)

End each command with parentheses ()

d)

Begin each line with a hashtag

4.

How should commands be organized in Karel programming?

a)

Alphabetically

b)

By complexity level

c)

In the order you want them to be executed

d)

By command length

5.

What is the purpose of defining a function?

a)

To create program bugs

b)

To teach the computer a new command

c)

To delete existing commands

d)

To rename variables

6.

What is snake case in Python?

a)

A type of programming error

b)

A debugging technique

c)

Writing style where spaces are replaced with underscores and first letters are lowercase

d)

A special Karel command

7.

What is decomposition in programming?

a)

Breaking your program into smaller parts

b)

Removing all program comments

c)

Combining multiple programs

d)

Converting code to binary

8.

What is a precondition?

a)

The final result of a function

b)

A type of programming loop

c)

An assumption about what must be true before calling a function

d)

A debugging technique

9.

What is a postcondition?

a)

A programming error

b)

What should be true after the function is called

c)

The first line of code

d)

A type of variable

10.

What is abstraction in programming?

a)

Writing longer code

b)

Adding more complexity

c)

Managing complexity by hiding unnecessary details

d)

Creating new bugs

11.

What is procedural abstraction?

a)

Writing complex code

b)

The ability to use methods we don't fully understand

c)

Creating new variables

d)

Debugging code

12.

What are APIs?

a)

A type of programming error

b)

Libraries that simplify complex programming tasks

c)

Karel commands

d)

Function names

13.

What is documentation in programming?

a)

A list of program errors

b)

Written instructions detailing functions and how to use them

c)

A type of loop

d)

Variable names

14.

What is a for loop?

a)

A type of program error

b)

A debugging technique

c)

Code that repeats a fixed number of times

d)

A documentation style

15.

What is the function body in Python?

a)

The name of the function

b)

The indented block of code after the function definition

c)

The function's documentation

d)

The function's parameters

16.

What is the purpose of comments in code?

a)

To execute commands

b)

To create variables

c)

To explain what is happening in the code

d)

To define functions

17.

What is Karel Documentation?

a)

A list of program bugs

b)

Documentation for all Karel Commands and Syntax

c)

A type of loop

d)

A debugging tool

18.

What is Top Down Design?

a)

A type of programming error

b)

A method for breaking programs into smaller parts

c)

A way to write comments

d)

A naming convention

19.

How should function names be written in Python?

a)

With spaces between words

b)

In all capital letters

c)

Using snake case

d)

With special characters

20.

What are bugs in programming?

a)

Special features

b)

Program documentation

c)

Errors in a program

d)

Function names