NEW
Font size
WorksheetsRevision Grade 8
Total questions: 22
Worksheet time: 11mins
What do you use the Pygame library for?
It is used to make graphics and sounds for video games.
It is used to create and manage data storage.
It is used to make graphical user interfaces.
It is used to control a turtle that can draw on the screen.
What code would you use to create the login button?
btn = Label (Window, text ="Login", bg='yellow', fg='purple')
btn = Button(Window, text ="enter", bg='red', fg='purple')
btn = Button(Window, text ="Login", bg='yellow', fg='black')
What is the name of the design drawings you need to use to represent your algorithms?
Sketches
Flowcharts
Instructions
Libraries
Which command should you use to repeat something 5 times
for A in range(1,6):
for A in range(0,5,2):
for A in range(1,11):
We use the following command for
File = open("myfile.txt", "r")
Opening a file for reading
Opening a file to add data
Opening a file for writing
We use the following command for
File = open("myfile.txt", «w")
Opening a file for reading
Opening a file to add data
Opening a file for writing
We use the following command for
File = open("myfile.txt", «a")
Opening a file for reading
Opening a file to add data
Opening the specified file
We use the following command for :
File.close()
Opening a file for reading
Closing the file
Opening a file for writing
We use the following command for
File.write ("Ibrahim" )
Print all the data inside the file
Opens a file to add data.
Start Writing inside the file
which one of the bellow print command is correct?
PRint("Hello World)
Pint ("Hello World")
print ("Hello World")
To check the value of the first element in the list, you can print it using its index [0].
True
False
To check the value of the second element in the list, you can print it using its index [2].
True
False
The correct code to print the value (40) from the following code is:
print(marks[0])
print(marks[1])
print(marks[5])
The correct code to print the value (70) from the following code is:
print(marks[0])
print(marks[6])
print(marks[5])
To add items to a list in python we use the command:
remove()
append()
count()
To remove items from a list in python we use the command:
remove()
append()
count()
Python is text -based Programming Language.
True
False
In line 3, time.sleep(2) is used for?
Waiting 2 seconds to print the following output
Reading from file.
Writing in the file.
What is the name of the file?
Fatima
Information.txt
Ibrahim
The list name of the following code is :
Fruit=[“banana”,”Apple”,”Orange”]
Fruit
Banana
Orange
How many items in the following list:
Fruit=[“banana”,”Apple”,”Orange”]
5
3
4
We use the following command for
for Line in File: print (Line.rstrip())
Printing all the data inside the file
Opening a file to add data
Creating a specified file
