diff --git a/week6/L1agenda.org b/week6/L1agenda.org new file mode 100644 index 0000000..61581e9 --- /dev/null +++ b/week6/L1agenda.org @@ -0,0 +1,23 @@ +* Agenda + + Review of lists (they're *not* arrays) + + Making a list + + Adding to a list + + Removing from a list + + Iterating over lists + + Review of while loops + + When to use a while-loop + + /why not to use While True/ + + Why you should get in the habit of using a main function + + Even if for your own python scripts you don't actually do it very often + + Programming time: + + https://online.pcc.edu/d2l/le/489961/discussions/topics/814822/View + + Hobbies program + + Let's program this *together* + + Tell me what to do + + Dictionaries review + + Like lists! + + But different! + + Adding functionality to our program + + Assignment 3 + + What's in it? What do you gotta do? + diff --git a/week6/hobbies.py b/week6/hobbies.py new file mode 100644 index 0000000..4ee18be --- /dev/null +++ b/week6/hobbies.py @@ -0,0 +1,19 @@ +# my own example of the hobbies discussion prompt + +# we need to write a main function in order to + +def main(): + # boolean variable to control + toContinue = True + hobbies = [] + while toContinue: + hobby = input("Enter one of your hobbies: ") + if hobby.lower() == "quit": + toContinue = False + print("Your hobbies were: ") + for h in hobbies: + print(h) + else: + hobbies.append(hobby) + +main()