This preview shows pages 1–15. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: approximate, the division result is approximate D. 3.45 divided by 3.0 is a little more than 1.15, theres nothing to explain E. We should have used integer division // for the correct result 6 Some math library functions 7 Some math library functions Using math library import math Prefix function name with math. 8 Explicit type conversion Force int to float or float to int 9 Rounding Allows specifying the number of decimal places 10 1D array of numbers [element , element 1 , , elemen n1 ] 0based indices len function returns length of array, i.e. the number of elements (n) 11 Traversal of 1D array, version 1 12 Using for loop Directly on elements Traversal of 1D array, version 2 13 Using range function Traversal of 1D array , version 2 14 Using range function and for loop on index SortMin in Python 15...
View
Full
Document
This note was uploaded on 02/27/2012 for the course CS 177 taught by Professor Staff during the Spring '08 term at Purdue UniversityWest Lafayette.
 Spring '08
 Staff

Click to edit the document details