CS 1110 Lecture Notes - Lecture 23: Infinite Loop

28 views3 pages

Document Summary

Prelim is very similar to fall 2014 test. We can read files and create a for-loop to print the file"s contents. Process each item in a sequence (for x in sequence: process x) Perform n trials or get n samples (for x in range sequence: proces x) If you get stuck in an infinite loop, cause a keyboarderror by pressing "control" + "c" at the same time. So you can assume that even if we do not say it. If m = n+1, the range has 0 values mn is a range containing n+1-m values. While loops are trickier, more dangerous, slower, but also more flexible than for loops. Great for when you must modify the loop variable. # remove all 3"s from the list t. Assertion: true-false statement places in a program to assert that it is true at that point. Can either be a comment or an assert command. An assert statement is an enforcement of an assertion.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents