SlideShare a Scribd company logo
LEARNING OBJECTIVES
Learn how to write code in Python script
mode.
LEARNING OUTCOMES
I can save code in Python’s script mode...
I can get keyboard input from users...
[ slide 3 ]
STARTER
Up until now we have not saved any files. We have
worked in interactive mode.
We can also save and run files too – in script mode.
To open a new script mode window:
1. Open IDLE and then from the File menu choose New
Window
2. To save this file choose Save from the File menu.
Lesson outcomes:
 I can save code in Python’s script
mode...
 I can get keyboard input from
users...
[ slide 6 ]
#COMMENTING
#Comments are used in Python to indicate what some part of the
code does.
#Comments always appear in red.
Lesson outcomes:
 I can save code in Python’s script
mode...
 I can get keyboard input from
users...
[ slide 1 ]
MAIN TASK 1
1. Log in to your computer
2. Open Python IDLE
3. Copy the code below to get the program to count to 10
>>> number=1
>>> while number < 11:
print(number)
number = number+1
4. Now in interactive mode, re-write the code so it prints the first 10 square
numbers e.g. 1, 4, 9, 16, 25, 36 ...
Don’t forget to add #Comments to indicate what the code does.
Lesson outcomes:
 I can save code in Python’s script
mode...
 I can get keyboard input from
users...
MINI PLENARY
Feedback your solution to the
rest of the class.
Lesson outcomes:
 I can save code in Python’s script
mode...
 I can get keyboard input from
users...
[ slide 9 ]
MAIN TASK 2
Write a Python file called friendly_computer.py
When run it should:
 ask the user for their name and store it in a variable
 say Hello to the user using the user’s name
 tell the user that it was nice talking to them
 say “Bye [name]”
Hint: You have done most of this in interactive mode.
Do not forget to save your file and send it to your teacher.
Lesson outcomes:
 I can save code in Python’s script
mode...
 I can get keyboard input from
users...
PLENARY
Why add a comment to the beginning of your
code?
In which two modes can you write code in
Python?
Don’t forget to upload your work to Moodle.
Lesson outcomes:
 I can save code in Python’s script
mode...
 I can get keyboard input from
users...

More Related Content

What's hot

Operating system lab task
Operating system lab taskOperating system lab task
Operating system lab task
hammad1515
 
Summer school
Summer schoolSummer school
Summer school
Omar Alhebsi
 
(6) cpp numeric representation_exercises
(6) cpp numeric representation_exercises(6) cpp numeric representation_exercises
(6) cpp numeric representation_exercises
Nico Ludwig
 
Open source software
Open source softwareOpen source software
Open source software
Luis Álamo
 
Copy of tutorial points
Copy of tutorial pointsCopy of tutorial points
Copy of tutorial points
soldiersduty
 
(3) cpp procedural programming_exercises
(3) cpp procedural programming_exercises(3) cpp procedural programming_exercises
(3) cpp procedural programming_exercises
Nico Ludwig
 
Code smells quality of code
Code smells   quality of codeCode smells   quality of code
Code smells quality of code
Hasan Al Mamun
 

What's hot (7)

Operating system lab task
Operating system lab taskOperating system lab task
Operating system lab task
 
Summer school
Summer schoolSummer school
Summer school
 
(6) cpp numeric representation_exercises
(6) cpp numeric representation_exercises(6) cpp numeric representation_exercises
(6) cpp numeric representation_exercises
 
Open source software
Open source softwareOpen source software
Open source software
 
Copy of tutorial points
Copy of tutorial pointsCopy of tutorial points
Copy of tutorial points
 
(3) cpp procedural programming_exercises
(3) cpp procedural programming_exercises(3) cpp procedural programming_exercises
(3) cpp procedural programming_exercises
 
Code smells quality of code
Code smells   quality of codeCode smells   quality of code
Code smells quality of code
 

Similar to Year 7 lesson 4 interactive and script mode

Python basics slides ch1
Python basics slides   ch1Python basics slides   ch1
Python basics slides ch1
conxxion
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
HaythamBarakeh1
 
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdfBASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
ashaks17
 
2 Getting To Know Your Programing Environment
2 Getting To Know Your Programing Environment2 Getting To Know Your Programing Environment
2 Getting To Know Your Programing Environment
dM Technologies
 
2 Getting To Know Your Programing Environment
2 Getting To Know Your Programing Environment2 Getting To Know Your Programing Environment
2 Getting To Know Your Programing Environment
guest9aa151
 
Lecture 2 introduction to python
Lecture 2  introduction to pythonLecture 2  introduction to python
Lecture 2 introduction to python
alvin567
 
Python programming
Python programmingPython programming
Python programming
Prof. Dr. K. Adisesha
 
kecs105.pdf
kecs105.pdfkecs105.pdf
kecs105.pdf
A23AyushRajBaranwal
 
PYTHO programming NOTES with category.pdf
PYTHO programming NOTES with category.pdfPYTHO programming NOTES with category.pdf
PYTHO programming NOTES with category.pdf
deivasigamani9
 
PYTHON PROGRAMMING NOTES.pdf
PYTHON PROGRAMMING NOTES.pdfPYTHON PROGRAMMING NOTES.pdf
PYTHON PROGRAMMING NOTES.pdf
RajathShetty34
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
Graphical interpreter report
Graphical interpreter   reportGraphical interpreter   report
Graphical interpreter report
Shiva Kumar K
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
natnaelmamuye
 
Computer Science 111 Computer Science I with Java and Pyth.docx
Computer Science 111 Computer Science I with Java and Pyth.docxComputer Science 111 Computer Science I with Java and Pyth.docx
Computer Science 111 Computer Science I with Java and Pyth.docx
mccormicknadine86
 
Python PPT1.pdf
Python PPT1.pdfPython PPT1.pdf
Python PPT1.pdf
DrSSelvakanmaniAssoc
 
PHYTON-REPORT.pdf
PHYTON-REPORT.pdfPHYTON-REPORT.pdf
PHYTON-REPORT.pdf
PraveenKumar640562
 
Introduction to python3.pdf
Introduction to python3.pdfIntroduction to python3.pdf
Introduction to python3.pdf
Mohammed Aman Nawaz
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptx
BharathYusha1
 
Core Python.doc
Core Python.docCore Python.doc
Core Python.doc
Jyoti shukla
 
Baabtra.com little coder course overview
Baabtra.com little coder  course overview Baabtra.com little coder  course overview
Baabtra.com little coder course overview
baabtra.com - No. 1 supplier of quality freshers
 

Similar to Year 7 lesson 4 interactive and script mode (20)

Python basics slides ch1
Python basics slides   ch1Python basics slides   ch1
Python basics slides ch1
 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
 
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdfBASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
BASIC_INTRODUCTION_TO_PYTHON_PROGRAMMING.pdf
 
2 Getting To Know Your Programing Environment
2 Getting To Know Your Programing Environment2 Getting To Know Your Programing Environment
2 Getting To Know Your Programing Environment
 
2 Getting To Know Your Programing Environment
2 Getting To Know Your Programing Environment2 Getting To Know Your Programing Environment
2 Getting To Know Your Programing Environment
 
Lecture 2 introduction to python
Lecture 2  introduction to pythonLecture 2  introduction to python
Lecture 2 introduction to python
 
Python programming
Python programmingPython programming
Python programming
 
kecs105.pdf
kecs105.pdfkecs105.pdf
kecs105.pdf
 
PYTHO programming NOTES with category.pdf
PYTHO programming NOTES with category.pdfPYTHO programming NOTES with category.pdf
PYTHO programming NOTES with category.pdf
 
PYTHON PROGRAMMING NOTES.pdf
PYTHON PROGRAMMING NOTES.pdfPYTHON PROGRAMMING NOTES.pdf
PYTHON PROGRAMMING NOTES.pdf
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
 
Graphical interpreter report
Graphical interpreter   reportGraphical interpreter   report
Graphical interpreter report
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
 
Computer Science 111 Computer Science I with Java and Pyth.docx
Computer Science 111 Computer Science I with Java and Pyth.docxComputer Science 111 Computer Science I with Java and Pyth.docx
Computer Science 111 Computer Science I with Java and Pyth.docx
 
Python PPT1.pdf
Python PPT1.pdfPython PPT1.pdf
Python PPT1.pdf
 
PHYTON-REPORT.pdf
PHYTON-REPORT.pdfPHYTON-REPORT.pdf
PHYTON-REPORT.pdf
 
Introduction to python3.pdf
Introduction to python3.pdfIntroduction to python3.pdf
Introduction to python3.pdf
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptx
 
Core Python.doc
Core Python.docCore Python.doc
Core Python.doc
 
Baabtra.com little coder course overview
Baabtra.com little coder  course overview Baabtra.com little coder  course overview
Baabtra.com little coder course overview
 

More from tmoncrieff

Lesson 3-health-and-safety
Lesson 3-health-and-safetyLesson 3-health-and-safety
Lesson 3-health-and-safety
tmoncrieff
 
Lesson 2-human-computer
Lesson 2-human-computerLesson 2-human-computer
Lesson 2-human-computer
tmoncrieff
 
Lesson 4 binary numbers
Lesson 4   binary numbersLesson 4   binary numbers
Lesson 4 binary numbers
tmoncrieff
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
tmoncrieff
 
Lesson 4 binary numbers
Lesson 4   binary numbersLesson 4   binary numbers
Lesson 4 binary numbers
tmoncrieff
 
Lesson 3-health-and-safety
Lesson 3-health-and-safetyLesson 3-health-and-safety
Lesson 3-health-and-safety
tmoncrieff
 
Lesson 2-human-computer
Lesson 2-human-computerLesson 2-human-computer
Lesson 2-human-computer
tmoncrieff
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
tmoncrieff
 
Year 7 lesson 5 if statements
Year 7 lesson 5   if statementsYear 7 lesson 5   if statements
Year 7 lesson 5 if statements
tmoncrieff
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
tmoncrieff
 
16 btec12 first_bus_u8_ps2
16 btec12 first_bus_u8_ps216 btec12 first_bus_u8_ps2
16 btec12 first_bus_u8_ps2
tmoncrieff
 
17 btec12 first_bus_u8_ps3
17 btec12 first_bus_u8_ps317 btec12 first_bus_u8_ps3
17 btec12 first_bus_u8_ps3
tmoncrieff
 
15 btec12 first_bus_u8_ps1
15 btec12 first_bus_u8_ps115 btec12 first_bus_u8_ps1
15 btec12 first_bus_u8_ps1
tmoncrieff
 
04 btec12 first_bus_u3_pp1
04 btec12 first_bus_u3_pp104 btec12 first_bus_u3_pp1
04 btec12 first_bus_u3_pp1
tmoncrieff
 

More from tmoncrieff (14)

Lesson 3-health-and-safety
Lesson 3-health-and-safetyLesson 3-health-and-safety
Lesson 3-health-and-safety
 
Lesson 2-human-computer
Lesson 2-human-computerLesson 2-human-computer
Lesson 2-human-computer
 
Lesson 4 binary numbers
Lesson 4   binary numbersLesson 4   binary numbers
Lesson 4 binary numbers
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
 
Lesson 4 binary numbers
Lesson 4   binary numbersLesson 4   binary numbers
Lesson 4 binary numbers
 
Lesson 3-health-and-safety
Lesson 3-health-and-safetyLesson 3-health-and-safety
Lesson 3-health-and-safety
 
Lesson 2-human-computer
Lesson 2-human-computerLesson 2-human-computer
Lesson 2-human-computer
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
 
Year 7 lesson 5 if statements
Year 7 lesson 5   if statementsYear 7 lesson 5   if statements
Year 7 lesson 5 if statements
 
Lesson 1 inputs and outputs
Lesson 1   inputs and outputsLesson 1   inputs and outputs
Lesson 1 inputs and outputs
 
16 btec12 first_bus_u8_ps2
16 btec12 first_bus_u8_ps216 btec12 first_bus_u8_ps2
16 btec12 first_bus_u8_ps2
 
17 btec12 first_bus_u8_ps3
17 btec12 first_bus_u8_ps317 btec12 first_bus_u8_ps3
17 btec12 first_bus_u8_ps3
 
15 btec12 first_bus_u8_ps1
15 btec12 first_bus_u8_ps115 btec12 first_bus_u8_ps1
15 btec12 first_bus_u8_ps1
 
04 btec12 first_bus_u3_pp1
04 btec12 first_bus_u3_pp104 btec12 first_bus_u3_pp1
04 btec12 first_bus_u3_pp1
 

Recently uploaded

Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 

Recently uploaded (20)

Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 

Year 7 lesson 4 interactive and script mode

  • 1.
  • 2. LEARNING OBJECTIVES Learn how to write code in Python script mode.
  • 3. LEARNING OUTCOMES I can save code in Python’s script mode... I can get keyboard input from users...
  • 4. [ slide 3 ] STARTER Up until now we have not saved any files. We have worked in interactive mode. We can also save and run files too – in script mode. To open a new script mode window: 1. Open IDLE and then from the File menu choose New Window 2. To save this file choose Save from the File menu. Lesson outcomes:  I can save code in Python’s script mode...  I can get keyboard input from users...
  • 5. [ slide 6 ] #COMMENTING #Comments are used in Python to indicate what some part of the code does. #Comments always appear in red. Lesson outcomes:  I can save code in Python’s script mode...  I can get keyboard input from users...
  • 6. [ slide 1 ] MAIN TASK 1 1. Log in to your computer 2. Open Python IDLE 3. Copy the code below to get the program to count to 10 >>> number=1 >>> while number < 11: print(number) number = number+1 4. Now in interactive mode, re-write the code so it prints the first 10 square numbers e.g. 1, 4, 9, 16, 25, 36 ... Don’t forget to add #Comments to indicate what the code does. Lesson outcomes:  I can save code in Python’s script mode...  I can get keyboard input from users...
  • 7. MINI PLENARY Feedback your solution to the rest of the class. Lesson outcomes:  I can save code in Python’s script mode...  I can get keyboard input from users...
  • 8. [ slide 9 ] MAIN TASK 2 Write a Python file called friendly_computer.py When run it should:  ask the user for their name and store it in a variable  say Hello to the user using the user’s name  tell the user that it was nice talking to them  say “Bye [name]” Hint: You have done most of this in interactive mode. Do not forget to save your file and send it to your teacher. Lesson outcomes:  I can save code in Python’s script mode...  I can get keyboard input from users...
  • 9. PLENARY Why add a comment to the beginning of your code? In which two modes can you write code in Python? Don’t forget to upload your work to Moodle. Lesson outcomes:  I can save code in Python’s script mode...  I can get keyboard input from users...