Pakistan International School, Jubail: Grade: 7 UNIT#1 "Block It Out: Moving From Block To Text" Question/Answer

You might also like

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

Pakistan International School, Jubail

1st Term, Academic Session 2023-24

GRADE: 7
UNIT#1
“BLOCK IT OUT: MOVING FROM BLOCK TO TEXT”
QUESTION/ANSWER
Q1: What is command prompt?

Ans: Command prompt is command line interface in windows where we can


execute commands and perform various tasks.

Q2: In how many ways Python can operate?

Ans: We can operate our Python program in two ways:

i. Interactive mode
ii. Script mode

Q3: What is an input ( ) command?

Ans: The input command allows users to enter information into the program
and store it in a variable. For example: name= input (“what is your name?”)
displays the message “what is your name?” on the screen and stores the input
from the user in a variable called name.

Q4: Explain the different data types in Python.

Ans: Following are the data types in Python:

i. String: Any textual characters, such as “Hello world” or “WE5694EMC”.


ii. Integer: Any whole number such as 24 or -10.
iii. Real: Any number with a decimal point such as 6.89 or -0.092.

Notes by: Ms. MARYAM ASLAM


Pakistan International School, Jubail
1st Term, Academic Session 2023-24

Q5: Write the steps to create a program in python.

Ans: Follow these steps to create a new program in python:

i. From the Python shell, select “File”.


ii. Then select “New File”.
iii. A new window will open and you can enter lines of code into the text
editor.
iv. Now type the command into the new file.

Q6: Write the steps to save a program in python.

Ans: Follow these steps to save a program in python:

i. From the python shell select “File”.


ii. Then select “Save as”.
iii. Call the program “Hello World” and save it.
iv. Note that all python programs will have .py at the end to show that they
are python files.

Q7: Write the steps to RUN a program in python.

Ans: Once you have completed the code you can RUN the program:

i. From text editor menu, select “RUN”.


ii. Then select “RUN module” or press F5. This will cause the python
interpreter to execute the program.
iii. The output from program will appear in the window of the shell.

Notes by: Ms. MARYAM ASLAM


Pakistan International School, Jubail
1st Term, Academic Session 2023-24

Q8: Write the steps to open an existing program n Python.

Ans: Following are the steps to open an existing program in Python:

i. From the Python shell select “File”


ii. Then select “Open”.
iii. Select the name of the file you wish to open.

Q9: What are the uses of key symbol of flowchart?

Start/stop symbol: Start/stop

Used at the start and the end of the flowchart to signify start and the end
of a program.

Process symbol: Process

Used when something needs to happen: e.g. add two numbers together.

Input/output symbol: Input/output

Used when data needs to be input and / or output from the program.

Decision symbol: Decision

Used to take decision or to choose one option from the question or


statement, e.g. true/false, yes/no, >/< etc.

Q10: Why we apply test plan in python?

Ans: We use test plan in python to outline the testing approach and ensure
through testing of our code.

Notes by: Ms. MARYAM ASLAM


Pakistan International School, Jubail
1st Term, Academic Session 2023-24

Q11: What is selection in Python?

Ans: A programming construct with more than one possible pathway is


known as selection. Selection occurs when a question is asked. It is important
in programming because the programmer can offer choices about the way in
which they move through the program selection is achieved using ‘IF’
statement.

Q12: What are the comparison operators in Python?

Ans: Symbols used to compare values are known as comparison operators


when using selection in any programming language, we need to use
comparison operators to compare values.
Following are the different comparison operators used when comparing
values:

Operator What it means

== equal to

< less than

> greater than

<= less than or equal to

>= greater than or equal to

!= not equal to

Notes by: Ms. MARYAM ASLAM


Pakistan International School, Jubail
1st Term, Academic Session 2023-24

Q13: What are the benefits of using subroutines in flowchart?

Ans: A mini program inside a program that can be completed or repeated


when requested is known as sub-routines.

Sub-routine offers several benefits:

i. Reusability: Can be called multiple times.


ii. Modularity: Separation of complex logic in parts.
iii. Readability: Easier to understand.
iv. Maintainability: Updates and changes become simple.

Notes by: Ms. MARYAM ASLAM

You might also like