- This event has passed.
7PM – Intro to Python – Joshua Widjanarko
October 24 @ 7:00 pm - 8:00 pm
Today We Did
- We reviewed for loops!
- Range = How we figure
- range() : How we can create Numeric Lists for for loops
- Three Inputs: range(starting number,last number in list +1, spacing)
- ex: range(2,9,2)=[2,4,6,8]
- Two Inputs: range(starting number, last number+1)
- you use two inputs if you know the spacing between numbers is 1
- ex range(3,7) = [3,4,5,6]
- One input range(last number +1)
- you use one input if you know the spacing between numbers is 1 and you want to start with zero
- ex. range(5) = [0,1,2,3,4]
- Three Inputs: range(starting number,last number in list +1, spacing)
- Reminders about for loops- For Loops: how we access an entire list
- Don’t forget to indent! All code you want to be looped/repeated should be one indent more than the for loop and right under it
- Another Reminder, the code under if/else statements need an additional indent
- Structure for a For loop is ->
- for <variable_name> in <name_of_list>:
- Code is indented here
- for <variable_name> in <name_of_list>:
- Don’t forget to indent! All code you want to be looped/repeated should be one indent more than the for loop and right under it
Homework and Reminders
- do the following exercises
- https://www.ayclogic.com/animal-list-and-for-loop-exercises/
- Copy/DoPage 56 to 58
- Name it For_range_practice_october_24.py
- Upload your answer to google drive before next week Wednesday night
If you have any questions feel free to email me jwidjanarko@ayclogic.com