wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Revision Grade 8

Total questions: 22

Worksheet time: 11mins

Name
Class
Date
1.

What do you use the Pygame library for?

a)

It is used to make graphics and sounds for video games.

b)

It is used to create and manage data storage.

c)

It is used to make graphical user interfaces.

d)

It is used to control a turtle that can draw on the screen.

2.

What code would you use to create the login button?

a)

btn = Label (Window, text ="Login", bg='yellow', fg='purple')

b)

btn = Button(Window, text ="enter", bg='red', fg='purple')

c)

btn = Button(Window, text ="Login", bg='yellow', fg='black')

3.

What is the name of the design drawings you need to use to represent your algorithms?

a)

Sketches

b)

Flowcharts

c)

Instructions

d)

Libraries

4.

Which command should you use to repeat something 5 times

a)

for A in range(1,6):

b)

for A in range(0,5,2):

c)

for A in range(1,11):

5.

We use the following command for

File = open("myfile.txt", "r")

a)

Opening a file for reading

b)

Opening a file to add data

c)

Opening a file for writing

6.

We use the following command for

File = open("myfile.txt", «w")

a)

Opening a file for reading

b)

Opening a file to add data

c)

Opening a file for writing

7.

We use the following command for

File = open("myfile.txt", «a")

a)

Opening a file for reading

b)

Opening a file to add data

c)

Opening the specified file

8.

We use the following command for :

File.close()

a)

Opening a file for reading

b)

Closing the file

c)

Opening a file for writing

9.

We use the following command for

File.write ("Ibrahim" )

a)

Print all the data inside the file

b)

Opens a file to add data.

c)

Start Writing inside the file

10.

which one of the bellow print command is correct?

a)

PRint("Hello World)

b)

Pint ("Hello World")

c)

print ("Hello World")

11.

To check the value of the first element in the list, you can print it using its index [0].

a)

True

b)

False

12.

To check the value of the second element in the list, you can print it using its index [2].

a)

True

b)

False

13.

The correct code to print the value (40) from the following code is:

a)

print(marks[0])

b)

print(marks[1])

c)

print(marks[5])

14.

The correct code to print the value (70) from the following code is:

a)

print(marks[0])

b)

print(marks[6])

c)

print(marks[5])

15.

To add items to a list in python we use the command:

a)

remove()

b)

append()

c)

count()

16.

To remove items from a list in python we use the command:

a)

remove()

b)

append()

c)

count()

17.

Python is text -based Programming Language.

a)

True

b)

False

18.

In line 3, time.sleep(2) is used for?

a)

Waiting 2 seconds to print the following output

b)

Reading from file.

c)

Writing in the file.

19.

What is the name of the file?

a)

Fatima

b)

Information.txt

c)

Ibrahim

20.

The list name of the following code is :



Fruit=[“banana”,”Apple”,”Orange”]

a)

Fruit

b)

Banana

c)

Orange

21.

How many items in the following list:

Fruit=[“banana”,”Apple”,”Orange”]

a)

5

b)

3

c)

4

22.

We use the following command for

for Line in File: print (Line.rstrip())

a)

Printing all the data inside the file

b)

Opening a file to add data

c)

Creating a specified file