CSCA20H3 Lecture : CSCA20 - WORKSHEET 4.pdf

208 views1 pages
School
Course

Document Summary

Built-in function input waits for the user to enter input. Once the user enters the input, the value of input() is the string which contains what the user entered. A while loop allows us to continue looping as. If step is omitted, the default is 1. If x is omitted, the default is 0. The step can also be negative: slicing lists, aliasing. Sometimes we have two variables that are names of the same object; they refer to the same object. Slicing creates a new object: nested lists, nest loops. While is a the python keyword condition is a boolean that must be true to enter/repeat the while loop. While-body is any set of python statement. Procedure: check to see if the condition is true. If the condition is false, we are done with the loop. Execute the entire body of the loop (even if the condition becomes false at some point).

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

Related Questions