cps6-110927Handout

cps6-110927Handout - Announcements CompSci 6 Introduction...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CompSci 6 Introduction to Computer Science September 27, 2011 Prof. Rodger CompSci 6 Fall 2011 1 Announcements • No Reading for next time • No Reading Quiz for next time • Apt-02 due tonight, Assignment 3 due Thursday • Exam next Tuesday • Work the practice exam before Thursday’s class. Will go over next class. CompSci 6 Fall 2011 2 List Comprehension review • Take advantage of patterns, make a new list based on per element calculations of another list • Format: [<expression with variable> for <variable> in <old list>] • Format with filtering: [<expression with variable> for <variable> in <old list> if <filter with variable> ] 3 List Comprehensions from last time [j+1 for j in range(20) if j%3==0] CompSci 6 Fall 2011 4
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
List Comprehensions from last time [j+1 for j in range(20) if j%3==0] [0, 1, 2, … 19] CompSci 6 Fall 2011 5 List Comprehensions from last time [j+1 for j in range(20) if j%3==0] [0, 1, 2, … 19] [1, 2, 3, …, 20] this is j+1 CompSci 6 Fall 2011 6 List Comprehensions from last time
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

cps6-110927Handout - Announcements CompSci 6 Introduction...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online