wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Coding Fundamentals

Total questions: 18

Worksheet time: 11mins

Name
Class
Date
1.

What is a variable in Python?

a)

A variable in Python is a command that executes a loop.

b)

A variable in Python is a symbolic name that references a value stored in memory.

c)

A variable in Python is a type of function that performs calculations.

d)

A variable in Python is a fixed value that cannot change.

2.

How do you declare a variable in Python?

a)

let variable_name = value

b)

set variable_name to value

c)

You declare a variable in Python by using the syntax: variable_name = value.

d)

variable_name : value

3.

What are the main data types available in Python?

a)

The main data types are: Tiky Tokys, Instagrammies, Tweets, Tripi Tropis, Tropa Tripas

b)

The main data types are: numbers, text, groups, decimal numbers and more.

c)

The main data types available in Python are: int, float, str, list, and bool.

d)

char

4.

What is the difference between an integer and a float?

a)

An integer can have decimals; a float cannot.

b)

An integer is a type of float with no decimals.

c)

An integer is a whole number; a float is a number that can have decimals.

d)

An integer is always negative; a float is always positive.

5.

How do you perform addition (suma) in Python?

a)

Use the '/' operator to divide numbers in Python.

b)

Use the '-' operator to subtract numbers in Python.

c)

Use the '*' operator to multiply numbers in Python.

d)

Use the '+' operator to add numbers in Python.

6.

How do you perform subtraction (resta) in Python?

a)

Use the '/' operator to divide numbers in Python.

b)

Use the '-' operator to subtract numbers in Python.

c)

Use the '*' operator to multiply numbers in Python.

d)

Use the '+' operator to add numbers in Python.

7.

How do you perform division in Python?

a)

Use the '/' operator to divide numbers in Python.

b)

Use the '-' operator to subtract numbers in Python.

c)

Use the '*' operator to multiply numbers in Python.

d)

Use the '+' operator to add numbers in Python.

8.

How do you perform multiplication in Python?

a)

Use the '/' operator to divide numbers in Python.

b)

Use the '-' operator to subtract numbers in Python.

c)

Use the "*" operator to multiply numbers in Python.

d)

Use the '+' operator to add numbers in Python.

9.

What is the purpose of the 'if' statement in Python?

a)

The purpose of the "if" statement in python is used to execute codes based on excuses.

b)

The purpose of the 'if' statement in Python is to execute code based on conditions.

c)

To create a loop in Python.

d)

To define a function in Python.

10.

What is a loop in programming?

a)

A loop is a type of variable used in programming.

b)

A loop is a data structure that stores multiple values.

c)

A loop is a function that executes only once.

d)

A loop is a control structure that repeats a block of code.

11.

What are the two main types of loops in Python?

a)

do while loop

b)

for loop and while loop

c)

foreach loop

d)

repeat until loop

12.

What function is used to take user input in Python?

a)

write()

b)

input()

c)

read()

d)

scan()

13.

How do you print output to the console in Python?

a)

Display output with the output() function.

b)

Use the print() function.

c)

Print to the console using log() method.

d)

Use the echo() function.

14.

What is the purpose of the 'while' loop?

a)

To execute a block of code only once

b)

To define a function

c)

The purpose of the 'while' loop is to execute a block of code repeatedly while a condition is true.

d)

To create a variable that stores data

15.

(a)   are used to store values in coding.

16.

A (a)   is used to automate codes based on decisions.

17.

A (a)   is used to repeat a block of code.

18.

The (a)   command is to used to show information on the python console.