cps6-110922 - [2 for v in nums[v*2 for v in nums CompSci 6...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CompSci 6 Introduction to Computer Science September 22, 2011 Prof. Rodger CompSci 6 Fall 2011 1
Image of page 1

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

View Full Document Right Arrow Icon
Announcements Read for next time Chap. 12 Reading Quiz on Blackboard – Due before class next time Assignment 3 out today Lab 4 – More on making decisions, using parameters CompSci 6 Fall 2011 2
Image of page 2
Creating a list Given a list of numbers, create a second list of every number squared. nums = [8, 3, 5, 4, 1] sqnums = [] for v in nums: sqnums.append(v*v) print sqnums [64, 9, 25, 16, 1] CompSci 6 Fall 2011 3
Image of page 3

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

View Full Document Right Arrow Icon