wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

COMPUTER 10 - ACTIVITY 5 - 2023-2024

Total questions: 35

Worksheet time: 25mins

Name
Class
Date
1.

To add a new element to a list we use which Python command?

a)

x.append(5)

b)

print([i])

c)

(list1)

d)

range(5)

2.

In Python, (a)   is used to request and get information from the user

3.
In python the ' BOOLEAN data type' can be defined as...?
a)
holds alphanumerical data
b)
holds whole numbers
c)
holds a number with a decimal point
d)
holds either true or false
4.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
5.

What is the Python built-in function used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command

6.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)

It displays an output

d)
It loops the code.
7.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name  = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
8.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
9.

Which of the following programs prints ten lines?

a)

for i in range(10):

print("hi")

b)

for i = 1 to 10:

print("hi")

c)

for i in 1 - 10:

print("hi")

d)

for i from 0 to 9:

print("hi")

10.

Which of the following for loops would print the following numbers?

3

5

7

9

a)

for i in range(3, 10, 2):

print(i)

b)

for i in range(3, 9, 2):

print(i)

c)

for i in range(9):

print(i)

d)

for i in range(3,9):

print(i)

11.

What is the value of num when this loop completes?


num = 0

for i in range(2, 8, 2):

num += i

a)

2

b)

8

c)

12

d)

20

12.

What command will ask the user his/her age correctly?

a)

age = input("How old are you?")

b)

age = input(How old are you?)

c)

input("How old are you?") = age

d)

how_old_are_you = input()

13.

What function will convert a number to a string?

a)

int()

b)

str()

c)

chr()

d)

ord()

14.

What is the result of this command: print ("5" + "3")

a)

8

b)

"8"

c)

"5" + "3"

d)

53

15.

Which function will convert a string containing only digits to a number?

a)

int()

b)

srt()

c)

chr()

d)

ord()

16.

Which conditional statement will be executed if the variable x is less than 20?

a)

if x > 20:

b)

if x <> 20:

c)

if x == 20:

d)

if x < 20:

17.

list1 = [7,8,9,10,11]

print(list1[o])

(a)  

18.

for i in range (5, 10):

print(i)

(a)  

19.

for i in range (-3, 7):

print(i*2)

(a)  

20.

for i in range (4, 17, 3):

print(i)

(a)  

21.

for i in range (30, 2,-5):

print(i)

(a)  

22.

list1 = [7,8,9,10,11]

print(list1)

(a)  

23.

Determine the shape (output) of the program below.

from turtle import *

for i in range(8):

right(45)

forward(100)

(a)  

24.

What will be the output if the user enters 'child' and 'friday'?

a)

£4.00

b)

£2.50

c)

There will be a syntax error

d)

£2.00

25.

What is the process of identifying and fixing errors in your code?

a)

Rebugging

b)

Syntax Solving

c)

Debugging

d)

Abstraction

26.

What in the name of the variable in this Python code?

a)

name

b)

input

c)

print

d)

("What is your name")

27.

Which of these codes is correct for creating a list of numbers?

a)

num = ('10','29','37','109')

b)

num = ['10','29','37','109']

c)

num == ('10','29','37','109')

d)

num = ['10 29 37 109']

28.

What brackets are used to create a list?

a)

()

b)

[]

29.

What will this code do?

a)

Print Numbers 1-11

b)

Print Numbers 1-10

c)

Print Numbers 2-10

d)

Print Error

30.

NBR=0

if NBR %2 != 0:

print("The input is an ODD number")

else:

print("The input is an EVEN number")

(a)  

31.

It is used to move the turtle to the center of the screen, which is typically the coordinates (0, 0).

(a)  

32.

It moves the turtle forward by a specified distance—in this case, 25 units—in the direction it is currently facing.

(a)  

33.

It rotates the turtle's heading (direction) to the left by a specified angle—in this case, 90 degrees.

(a)  

34.

When the pen is up, the turtle will move without drawing lines on the screen.

(a)  

35.

It rotates the turtle's heading (direction) to the right by a specified angle—in this case, 45 degrees.

(a)