Moving From Blocks to Text L2-Difference Between Scriptmode and Interactive Modenotes
Moving From Blocks to Text L2-Difference Between Scriptmode and Interactive Modenotes
1-BLOCK IT OUT:
MOVING FROM BLOCKS TO TEXT
GRADE 6
TOPIC:USING PYTHON IDLE IN SCRIPTMODE
AND INTERACTIVE MODE
EXPLORE AND EVALUATE
Task : Match and Define Activity : Place each item from the list below into one of two categories:
LIST :
•Python
•Java
•YouTube
•Microsoft Word
•C++
•Calculator
instructions Program
Programming languages
Programmer/developer
NOTES
1. A ______ is a specialized language used to communicate instructions to a computer and allow it to perform tasks.
2. Python is an example of a ______, which provides a structured way for users to give commands to a computer.
3. A ______ consists of a set of instructions created using a programming language to perform specific tasks on a
computer.
4. A person who writes, tests, and debugs code using a programming language is called a ______.
5. The purpose of a ______ is to enable humans to give instructions to computers, creating everything from websites to
games.
6. Languages like Java, C++, and Python are all examples of a ______.
7. A ______ develops applications, games, and software by writing code that computers can understand and execute.
Answers:
1.programming language
2.programming language
3.Program
4.Programmer
5.programming language
6.programming language
7.programmer
WORKING IN PYTHON
INTERACTIVE MODE
SCRIPT MODE
INTERACTIVE MODE IS WHERE YOU TYPE
ONE-LINE COMMANDS AND THEY ARE SCRIPT MODE IS WHERE YOU PUT A
IMMEDIATELY EXECUTED. BUNCH OF COMMANDS INTO A FILE AND
Python shell THEN TELL PYTHON TO RUN THE FILE.
window
Entry prompt
File New
ShortcutCtrl+N
• LO :Able to define programming language.
• Able to differentiate two working modes in python.
DIFFERENCE NOTES
Interactive mode Script mode
User can type in commands and see the results User can type a bunch of commands into a file ,
straight away and then tell Python to run the file
The interactive mode is more suitable for one-time Script mode is more suitable when there is a need
tasks. to automate tasks or when the same task needs to
be carried out several times.
Interactive mode can be edited in the same Script mode is usually edited in a text editor and
window then run as a batch process.
Interactive mode produces output that is displayed Script mode produces output that can be saved
on the screen and then disappears. and reused.
Interactive mode cannot be saved. Script mode can be saved in a text file.
Interactive mode is used to execute line by line Script mode is used to execute a block of code
expression
Activity 1: Find the missing words from the options given below
11
Activity 2 :Compare and fill in the comparison chart
12
Aspect Interactive Mode Script Mode
Interactive mode allows users Script mode allows users to
to type and run Python write multiple lines of code in
Definition
commands one by one in the a file and run them all at
Python shell. once.
Script mode
14
Complex Example
Interactive mode
Script mode
15
Activity 3: Using the following Python code analyze them for both Interactive Mode and Script Mode.