wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

H SDD - Pre-defined functions (revision)

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

Which of the following Python pre-defined functions could be used to return the ASCII value of a character?

a)

ORD

b)

LEN

c)

CHR

d)

ROUND

2.

Which of the following Python pre-defined functions could be used to return the character which matches an ASCII value?

a)

ORD

b)

LEN

c)

CHR

d)

ROUND

3.

Which of the following Python pre-defined functions could be used to return the number of characters in a string

a)

ORD

b)

LEN

c)

CHR

d)

ROUND

4.

Which of the following is the correct output from the following code:

a)

21th Mar 2022

b)

21th Ma 22

c)

21st Mar 22

d)

21th Mar 22

5.

What would the correct output for the following code be?

String = "Falkirk High School"

print(String[8:10] + " " + String[0:7])

a)

Hi Falkirk

b)

Hi School

c)

Fa High Sc

d)

Hi kirk H

6.

Which of the following Python pre-defined functions could be used to convert a floating point number to a whole number?

a)

ORD

b)

LEN

c)

INT

d)

ROUND

7.

Which of the following Python pre-defined functions could be used to convert a floating point number to a whole number?

a)

ORD

b)

LEN

c)

INT

d)

ROUND

8.

Which of the following pieces of code would return the output 2?

a)

print(ord("!"))

b)

print(int(2.34543))

c)

print(14%7)

d)

print(14%6)

9.

Which of the following pieces of code would return the output 5?

a)

print(12%9)

b)

print(14%8)

c)

print(14%9)

d)

print(12%6)