Introduction to Python Programming Lesson 1 - January 2018
In this lesson, students are introduced to Python programming with a focus on functions, if statements, and the difference between = and ==. The lesson includes activities and exercises to practice these concepts. Students engage in group discussions, hands-on coding tasks, and review sessions to solidify their understanding of the material and prepare for future quizzes.
Download Presentation
Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
Python Programming January 2018 Lesson 1 of 10
PR I M M Do Now Look at these questions and choose the right answer. Question 1 Question 2 Here is some Python code Here is some Python code What would be printed on the screen? a. 25 b. 15 c. 20 d. 5 What would be printed on the screen? a. 235 b. 145 c. 130 d. 255 Now discuss in groups of 3 make a decision and then share your answers
Lesson objectives Today we are using three new Python keywords: - def - if - else At the end of this lesson you should be able to - write a function using def - write programs that give different responses depending on what is typed in at the keyboard - Know the difference between = and ==
PR I M M Activity 20 minutes Follow the worksheet Tasks 1 3 Check your answers on the answer sheet when you have finished
PR I M M Activity Your answers 1. 2. What would happen if the program used the word Print() instead of print() ? What would happen if you type Yes instead of yes or no when running the program? (try it and see) What is def used for? Why does the program include conversation() at the bottom of the program? Why do you need a colon : at the end of the if statement and the word else? What is the difference between = and == ? Both are used in this program. What would be the difference between running these two lines answer = input() answer = input( Select 1 or 2 ) ? Why is print( Goodbye ) a few spaces left of the lines above? What happens if you change this? 3. 4. 5. 6. 7. 8.
PR I M M Exercises 20 mins Now work through the exercises in Task 4 in pairs
PR I M M Review What is the difference between the two questions when they appear on the screen?
PR I M M Review - answer In the next lesson we will be writing a quiz.