wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz 1 (Dict)

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.
a)

1

b)

2

c)

3

d)

4

2.
a)

{'name': 'mohamed', 'age': 25, 'GPA': 4.0, 'friends': ['mohamed', 'amr']}

b)

{'name': 'ahmed', 'age': 25, 'GPA': 4.0, 'friends': ['mohamed', 'amr']}

c)

{'name': 'ahmed', 'age': 25, 'GPA': 4.0, 'friends': ['ahmed', 'amr']}

d)

error

3.
a)

{'name': 'ahmed', 'age': 25, 'GPA': 4.0, 'friends': ['mohamed', 'mohannad']}

b)

{'name': 'ahmed', 'age': 25, 'GPA': 4.0, 'friends': ['mohamed', 'amr', 'mohannad']}

c)

{'name': 'mohannad', 'age': 25, 'GPA': 4.0, 'friends': ['mohamed', 'amr']}

d)

error

4.

x = {1}
print(type(x)

a)

list

b)

dict

c)

set

d)

tuple

5.

x = [ {'name': 'ibrahim', 'age': 25}, {'name': 'mohamed', 'age': 24} ]
print(x)

a)

[ {'name': 'ibrahim', 'age': 25}, {'name': 'mohamed', 'age': 24} ]

b)

[ {'name': 'mohamed', 'age': 24} ]

c)

error

d)

[ {'name': 'ibrahim', 'age': 25} ]

6.

1st_name = 'ahmed'

age = 25

x = {'name': 1st_name, 'age': age}
print(x)

a)

error

b)

{'name': 'ahmed', 'age': 25}

c)

{'name': 1st_name, 'age': age}

d)

nothing is shown

7.

my name = 'Ali'

job = 'student'

x = [my name, job]

print(x)

a)

[my name, job]

b)

['Ali', 'student']

c)

error

d)

2

8.

name = 'cat'

age = 35

x = {'name' = name, 'age' = age}

print(x)

a)

{'name' = name, 'age' = age}

b)

{'name' = 'cat', 'age' = 35}

c)

x

d)

error

9.

the correct to way to open a file named my_file.txt for writing is:

a)

with open('my_file.txt') as VAR:

b)

with open('my_file.txt', 'r') as VAR:

c)

with open('my_file.txt', 'w') as VAR:

d)

with open('my_file.txt', 'w') as VAR

10.

Draw something within 2 minutes to share with your friends