ICT Grade 7 Worksheet Chapter 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

WINTERNATIONAL SCHOOLS NATIONAL SCHOOLS

☒ AHIS – Khobar ☐ AHNS-Boys – Dammam


☐ OIS – Khobar ☐ AHNS-Girls – Dammam
☐ JIS – Jubail ☐ AHNS-Boys – Jubail
☐ AHIS – Riyadh ☐ AHNS-Girls – Jubail
☐ AHIGS – Aqrabia ☐ AHNS – Riyadh
☐ AHIS – Yanbu ☐ Ajyal – AHNS

Name:……………………………………. Grade: 7 Section:………………….

ICT Worksheet Chapter 3


LESSON -3.1

Question 1: Choose the correct answer from the options given:


1. What is the purpose of the 'Event' block in a Scratch program?

a) To start the program


b) To store user inputs
c) To display outputs
d) To create variables

2. What is the first block in a Scratch program?

a) An 'Event' block
b) A variable block
c) An operator block
d) A say block

3. What is an interface in programming?

a) A way for users to interact with the program


b) A type of variable
c) A programming language
d) A method to store values

4. What are the four arithmetic operators commonly used in programming?


a) Add, Subtract, Multiply, Divide
b) Add, Subtract, Combine, Separate
c) Add, Multiply, Divide, Modulo
d) Multiply, Divide, Concatenate, Add
1
5. What block should be used in Scratch to start a program?
a) "Control" block
b) "When green flag clicked" block
c) "When this sprite clicked" block
d) "Operator" block

6. In the algorithm for adding two numbers, what are the key inputs?
a) Number 1 and Result
b) Number 2 and Operator
c) Number 1 and Number 2
d) Result and Input

7. An algorithm sets out the inputs and outputs of a program. What else does it set out?
a) The programming language
b) The hardware requirements
c) The processes to transform inputs into outputs
d) The cost of development

8. In Scratch, what variable can store the user's input?

a) result
b) answer
c) number 1
d) number 2

9. Which block in Scratch is used to get user input?

a) when this sprite clicked


b) ask
c) say
d) answer

2
10. Scratch provides two ready-made Variables are

a) result and answer


b) answer and my variable
c) score and result
d) my variable and score

Question 2: State whether the following statements are true or false:

1. The Scratch programming language allows users to create colorful interfaces.


2. An algorithm is a plan to solve a problem.
3. Variables in Scratch cannot store values.
4. The program starts when the user clicks on Green Flag in Scratch..
5. The 'my variable' in Scratch is an event block.

Question 3: Fill in the blank with the correct words.

Algorithm Arithmetic operators Interface Program Requirement


Stage Variable Sprite Variable Name

1. ____________________are symbols and terms used in programming and used to perform


mathematical calculations.

2. ____________________is a plan to solve a problem.

3. ____________________is how a user interacts with the program.

4. ____________________is the background area where sprites move and interact.

5. ____________________is used to store a value that can change.

6. ____________________is the character or object in your scratch project.

7. ____________________tells you what the program must do.

8. ____________________ is used to remind you what value the variable will store.

3
Question 4: Answer the Following:
1. Explain the purpose of an event block from scratch.
______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

2. What are the methods to enter input to programs?


______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

3. What are the methods to get output in a program?


______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________
4. Explain the concept of a variable in programming.
______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

5. What is the role of a sprite in a Scratch program?


______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

4
6. How can you use the 'ask' block to get user input in Scratch?
______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

7. What is the difference between an algorithm and a program?


______________________________________________________________________________

______________________________________________________________________________

______________________________________________________________________________

8. Write an algorithm to subtract two given numbers.


_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

5
LESSON -3.2
Question 1: Choose the correct answer from the options given:

1. What does the prompt in the function “input “do?

a) It stores the user input.


b) It tells the user what to input.
c) It displays the output.
d) It creates a variable.

2. What symbol is used to assign a value to a variable in Python?

a) +
b) -
c) =
d) *

3. Which Python command is used to get user input?


a) print()
b) input()
c) ask()
d) scan()

4. How do you display output in Python?


a) display()
b) output()
c) print()
d) show()

5. What does the following Python command do? name = input("What is your name? ")
a) It assigns "What is your name?" to the variable name.
b) It prints the question and stores the user's input in the variable name.
c) It prints the variable name.
d) It creates a variable with a default value of "What is your name?".
6
6. What is Python?
a) A type of computer hardware
b) A text-based programming language
c) A graphical user interface
d) A web browser

7. What is the Python Shell?


a) A physical device used to run Python programs
b) A window where you can enter and execute Python commands
c) A type of programming error
d) A graphical programming environment

8. Which of the following is a correct way to assign the value "Hello, world!" to a variable
named greeting?
a) greeting = "Hello, world!"
b) "Hello, world!" = greeting
c) set greeting to "Hello, world!"
d) print("Hello, world!")

9. What is the purpose of the input() function in Python?


a) To display text on the screen
b) To perform mathematical calculations
c) To get input from the user
d) To create a new variable

10. Which of the following is a common error in Python programming?


a) Using uppercase letters for variable names
b) Forgetting to indent code blocks
c) Using quotation marks to enclose numbers
d) All of the above

7
11. What should you do if you receive an error message in Python?
a) Ignore it and continue
b) Read it to understand the mistake and correct it
c) Restart the Python Shell

Question 2: State whether the following statements are true or false:

1. In Python, a variable name can contain spaces.


2. Error messages in Python help identify mistakes in your code.
3. The print function in Python is used to get user input.
4. In Python, a variable name should always start with a letter.
5. Python is case-sensitive, meaning Print and print are treated as different
commands.

Question 3: Fill in the blank with the correct words.

prompt Python Python Shell input() print

1. The text inside the brackets of the Input function is called the_____________

2. When you start Python, a window opens, this is called _____________

3. _____________is a text-based programming language.

4. _____________is a Python command is used to get user input.

5. _____________ is used to produce output in python.

8
Question 4: Answer the Following:
1. How do you get user input in Python?
___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

2. What should you do if you make a mistake when typing a Python command?
___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

3. How do you set a variable's value in Python?


___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

4. What is the purpose of the Python Shell?

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

5. Explain how error messages help you to be a good programmer.


___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

6. What are the basic rules for naming variables in Python?


___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

9
7. Write the Python command to create a variable called city with the value "Paris".
___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

8. Write the Python command to ask the user "How old are you?", get their input, and
store it as the variable age.
___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

9. Write a Python program that asks the user for their name and age. Then, print a
message that greets the user and tells them their age in 5 years
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
__________________________________________________________________________

10
LESSON -3.3
Question 1: Choose the correct answer from the options given:

1. What is the advantage of making a program file instead of typing commands in the
Python Shell?

a) It saves typing effort and reduces the chance of errors.

b) It makes the program run faster.

c) It allows you to use more variables.

2. Which menu do you use to create a new file in the Python Shell?

a) Edit

b) File

c) Run

3. What do different colors in the Python program file window help you identify?

a) Errors in the program

b) Different types of program content such as variables, symbols, and functions

c) The speed of the program

4. What error message would you see if you forget to put quote marks around a text
string?

a) NameError: name 'hello' is not defined

b) Syntax Error: invalid syntax

c) EOL while scanning string literal

5. What tool do you use to save Python commands as a program file?

a) The Python Shell

b) A text editor

c) A web browser

11
6. What does the error message "NameError: name 'variable' is not defined" mean?

a) You forgot to close the program file.


b) You used a reserved word as a variable name.
c) The variable doesn't exist in the program.

7. What is an IDE (Integrated Development Environment)?

a) A program that translates Python code to machine code.


b) A software environment for writing, editing, and running Python programs.
c) A library of pre-written Python code snippets.

8. Which menu option do you use in the Python Shell to create a new file?

a) Run → New File


b) File → Open
c) File → New File

9. What happens when you click on ‘Run Module’ in the Python IDE?

a) It saves the program file.


b) It highlights syntax errors in the program.
c) It executes all commands in the program file.

10. In the Python program file window, what color are text strings displayed?

a) Black

b) Purple

c) Green

12
11. Which of the following is the correct way to print "hello" in Python?

a) Print(hello)
b) print(hello)
c) print("hello")

12. Which of the following is NOT a feature of the Python IDE?

A) Syntax highlighting

B) Immediate command execution

C) Automatic error correction

D) File saving capabilities

Question 2: State whether the following statements are true (T) or false (F):

1.In the Python program file window, variable names are displayed in green
2. Text strings in Python are shown in purple in the program file window
3. Errors in Python can prevent a program from running.
4. A program file in Python can be edited and saved multiple times.
5.The 'Print' command in Python should start with a capital letter.

Question 3: Fill in the blank with the correct words.

EOL while
print Web page IDE File NameError scanning
string literal.

1. The software used to write and run programs in Python is called an ____________.

2. The command to display output in Python is ______________.

3. The IDE for Scratch is a _________________based programming environment.

4. The __________ menu in the Python Shell is used to create and save new program files.

5. When you forget to put quote marks, the error message says__________

6. When you forget to close a string with a second set of quote marks, the error message
says __________.
13
Question 4: Answer the Following:
1. What should you do to fix the error in the command 'Print(hello)'?
___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

2. What is the advantage of making a program file instead of typing commands in the
Python Shell?
___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

3. What are the different colors used in the Python program file window, and what do they
represent?
___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

4. Describe the purpose of the Integrated Development Environment (IDE) in Python


programming.
___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

14
5. Explain two different ways you can find errors in your Python programs.
____________________________________________________________________________

____________________________________________________________________________

____________________________________________________________________________

___________________________________________________________________________

____________________________________________________________________________

___________________________________________________________________________

____________________________________________________________________________

___________________________________________________________________________

6. Describe one difference between the IDE for Scratch and the IDE for Python.

____________________________________________________________________________

____________________________________________________________________________

____________________________________________________________________________

___________________________________________________________________________

____________________________________________________________________________

___________________________________________________________________________

____________________________________________________________________________

___________________________________________________________________________

15
LESSON -3.4
Question 1: Choose the correct answer from the options given:
1. What is a data type in Python?
a) a way to organize your code
b) a category that defines how data is stored and used
c) a special keyword used in functions

2. What data type is used to store whole numbers (without decimals)?


a) String
b) Integer
c) Float

3. What happens when you try to add two strings in Python?


a) You get an error message.
b) The strings are added together character by character.
c) The strings are converted to numbers and then added.

4. What Python function can be used to convert a string to an integer?


a) convert()
b) int()
c) change Type()

5. What is the purpose of the print() function in Python?


a) To store data in a variable
b) To perform calculations
c) To display output on the screen

6. Why did a python program output "8090" instead of the sum of 80 and 90?
a) forgot to add a print statement.
b) Input values are stored as strings by default in Python.
c) Python does not support addition of numbers entered as input.
16
7. Which Python function converts a string to an integer?
a) str()
b) int()
c) input()
8 .What will the following code output? print("Python" * 3)
a) "PythonPythonPython"
b) "Python 3"
c) "Python"

9. Which data type can be used in mathematical calculations in Python?


a) String
b) Integer and Float
c) Boolean

10. What does the command number = float(number) do?


a) Converts a number to a string.
b) Converts a number to an integer.
c) Converts a number to a float.

11. What does the command number1 = 80 do in the Python Shell?

a) It prints the number 80.

b) It creates a variable called number1 and assigns it the value 80.

c) It deletes a variable called number1.

12. If you enter the command total = number1 + number2 in Python, what does it do?

a) It prints the values of number1 and number2.

b) It creates a variable called total and assigns it the sum of number1 and number2.

c) It multiplies number1 and number2.


17
13. What will be the output if you run the command print(total) after setting number1 = 80
and number2 = 90 in Python without converting their types?

a) 170

b) 8090

c) Error

14. How can you convert a string variable to an integer in Python?

a) variable = str(variable)

b) variable = float(variable)

c) variable = int(variable)

15. data type is used to represent whole numbers in Python?

a) String

b) Integer

c) Float

16. Which of the following is a valid way to declare a variable in Python?

a) 1variable = 10

b) variable1 = 10

c) variable 1 = 10

18
Question 2: State whether the following statements are true or false:

1. The int() function can be used to convert a float to an integer.


2. The + operator can be used for both addition and string concatenation in Python.
3. You can perform arithmetic operations directly on string variables in Python
without any conversion.
4. The print () function can convert a string representation of a number into a float.
5. In Python, user input is always stored as a string.
6. Variables in Python are created automatically when a value is assigned to them
7. String data can include any characters from the keyboard.
8. The input function in Python stores user data as a float by default.
9. All Arithmetic operators can add two string variables in Python.
10. ASCII characters are stored as string data type in Python.

Question 3: Fill in the blank with the correct words.

Input() float + string integer

1. A variable that stores a decimal number is typically of the ___________ data type.

2. In Python, the function used to get user input is called __________.

3. In a String, the __________sign joins the strings together.

4. ASCII characters are stored as __________ data type.

5. Whole numbers are stored as __________data type.

19
Question 4: Answer the Following:
1. What are the different data types in Python?
________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

2. How can you convert a string to an integer in Python?


________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

3. What are the steps to create a Python program that adds two numbers together?
_________________________________________________________________________________

___________________________________________________________________________________

___________________________________________________________________________________

_________________________________________________________________________________

4. Write a command to convert the points variable to any numerical data type (integer or float).
_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

5. Write the Python command to assign value 9.99 to a variable called price.

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________
20
6. Write a Python expression to calculate the area of a rectangle with width 5 and height 3.

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

7. What will this Python command do? print("-" * 35)

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

8. Write a Python program that:


1. Asks the user to input a number.
2. Outputs a line of dashes equal to the number entered.

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

_________________________________________________________________________________

________________________________________________________________________________

With best Wishes

21

You might also like