wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

الاختبار العملي لوحدة " البرمجة بلغة بايثون"

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

nums = [10, 20, 30]

nums.append(40)

print(nums)

a)

[10, 20, 30]

b)

[10, 20, 30, 40]

c)

[40, 10, 20, 30]

d)

خطأ برمجي

2.

colors = ["red", "blue", "green"]

print(colors[1])

a)

blue

b)

green

c)

1

d)

red

3.

names = ["Ali", "Sara", "Mona"]

names.remove("Sara")

print(names)

a)

["Ali", "Sara"]

b)

["Sara", "Mona"]

c)

["Ali", "Mona"]

d)

['Ali', 'Mona']

4.

numbers = [1, 2, 3, 4]

print(numbers[-1])

a)

1

b)

2

c)

3

d)

4

5.

letters = ["A", "B", "C"]

letters.insert(1, "D")

print(letters)

a)

["A", "B", "C", "D"]

b)

["B", "C", "D"]

c)

["D", "A", "B", "C"]

d)

["A", "D", "B", "C"]

6.

student = {"name": "Aisha", "age": 15}

print(student["name"])

a)

age

b)

15

c)

Aisha

d)

name

7.

animals = ["cat", "dog", "rabbit"]

animals.append("hamster")

print(animals)

a)

خطأ برمجي

b)

["cat", "dog", "rabbit", "hamster"]

c)

["cat", "dog", "rabbit"]

d)

["hamster", "cat", "dog", "rabbit"]

8.

book = {"title": "Python"}

book["pages"] = 120

print(book)

a)
{"title": "Python", "author": "John"}
b)
{"title": "Java", "pages": 150}
c)

{'title': 'Python', 'pages': 120}

d)
{"title": "Python", "pages": "one hundred twenty"}
9.

person = {"first_name": "John", "last_name": "Doe"}

person["age"] = 30

print(person)

a)

{'first_name': 'John', 'last_name': 'Doe', 'age': 30}

b)

{"first_name": "Doe", "last_name": "John"}

c)

{'first_name': 'John', 'age': 30}

d)

{"last_name": "Doe", "age": 30}

10.

numbers = [[1, 2], [3, 4]]

print(numbers[1][0])

a)

1

b)

2

c)

3

d)

4