Difference between revisions of "Computer Science I"
From WLCS
Line 14: | Line 14: | ||
* Adding and deleting from a list | * Adding and deleting from a list | ||
* Complete and demo [[Python List Exercises]] | * Complete and demo [[Python List Exercises]] | ||
+ | * Begin working on [[Advanced Python List Exercises]] | ||
== Thursday (5/13/10) == | == Thursday (5/13/10) == |
Revision as of 09:16, 17 May 2010
Contents
Monday (5/17/10)
Warmup:
- Create a list that contains the following numbers: 8, 6, 7, 5, 3, 0, 9
- Create a variable named total that contains the value 0
- Initialize a counter variable named x to 0
- Write a while loops that runs while x is less than the length of your list
- Inside your loop, add the current element (yourList[x]) to total
- Increment your loop counter x
- Print the total variable, which should now be the sum of all the numbers
Agenda:
- Warmup Review
- Why do we use lists and loops? Use your warmup again, but instead, make the list hundreds of numbers
- Adding and deleting from a list
- Complete and demo Python List Exercises
- Begin working on Advanced Python List Exercises
Thursday (5/13/10)
Warmup - Regular:
- Write down a list of your favorite sports teams
- Write down a list of the numbers in your phone number (or any other number)
Agenda:
- Introduction to Lists
- Python List Exercises
Tuesday (5/11/10)
Warmup - Regular:
- Write a loop that prints 0 through 20
- Write a loop that prints 19 through 0
- Write a loop that goes from 0 through 100 BUT only prints numbers if they are less than 20
Agenda:
- Strings quiz
- Complete HTTLACS: Ch7 #5-8 this week
Friday - Tuesday (5/7/10)
- Demo a completed E-mail Harvester Assignment
- Strings quiz
- Complete HTTLACS: Ch7 #5-8 this week
Wednesday (5/5/10)
Agenda:
- Demo a completed E-mail Harvester Assignment
- Strings quiz review
- Quiz on Ch 7: strings and e-mail harvester (closed-book) on Friday
- Complete HTTLACS: Ch7 #5-8 this week
Monday (5/3/10)
Warmup:
- s = "H e l l o , w o r l d !"
- Create a variable named new_s that contains an empty string
- Write a while loop where the counter variable x starts at 0 and goes up to len(s)
- Check if the current letter at x (s[x]) is NOT a space
- Add the current letter (s[x]) to new_s
- Increment x
- Check if the current letter at x (s[x]) is NOT a space
- What does the above code produce?
Agenda:
- Demo a completed E-mail Harvester Assignment
- Quiz on strings and e-mail harvester (closed-book) on Friday
- Complete HTTLACS: Ch7 #5-8 this week