wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Data Types

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What will be the result of the following code:

x = 'Welcome'

print(x[3])

a)

Wel

b)

c

c)

Welcome Welcome Welcome

2.

Which of the follwing repersents list data type?

a)

N={1,2,3}

b)

N=[1,2,3]

c)

N= (1,2,3)

3.

If x = 9, what is a correct syntax to print 'The price is 9 dollars'?

a)

print(f'The price is {x:f} dollars')

b)

print(f'The price is {x} dollars')

c)

print(f'The price is {x:f(2)} dollars')

4.

What will be the result of the following code:

prinThe price is 23 dollars

a)

The price is 5 dollars

b)

The price is {2 + 3} dollars

c)

The price is 6 dollars

d)

t(f'The price is {2 + 3} dollars')

5.

True or False.

List items cannot be removed after the list has been created.

a)

True

b)

False

6.

Whis one of theese is a dictionary?

a)

x = ('apple', 'banana', 'cherry')

b)

x = {'type' : 'fruit', 'name' : 'banana'}

c)

x = ['apple', 'banana', 'cherry']

7.

True or False.

Dictionary items cannot be removed after the dictionary has been created.

a)

True

b)

False

8.

Whis one of these is a tuple?

a)

thistuple = ('apple', 'banana', 'cherry')

b)

thistuple = ['apple', 'banana', 'cherry']

c)

thistuple = {'apple', 'banana', 'cherry'}

9.

Use the correct syntax to print the number of items in the fruits tuple.

fruits = ("apple", "banana", "cherry")

a)

print(len(fruits))

b)

print(len[fruits])

c)

print(len{fruits})

10.

The items of the set is unordered

a)

True

b)

False