Class Notes (836,861)
Canada (509,934)
CMPT 120 (49)
Greg Baker (15)
Lecture

Repetition and For Loops

2 Pages
101 Views
Unlock Document

Department
Computing Science
Course
CMPT 120
Professor
Greg Baker
Semester
Fall

Description
100107CMPT 120RepetitionWe need to be able to repeat pieces of codeoegDo the same calculation many times on many values search until we find something etcRepetition generally falls into two categorieso1 You know initially how many repetitions you needas you start the repetition you knowcan calculate how many timesdefinite iterationo2 You dont know when to stop until youre therehave some condition to describe when to continuefinishindefinite iterationThe for loopsa construct to do definite iteration in Pythonohave to know how many timesstart of the loopsimple example count from 1 to a value the user entersnumintrawinputH
More Less

Related notes for CMPT 120

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit