CMPT 120 Lecture Notes - Lecture 8: Duplicate Code

28 views1 pages
meghan78 and 39786 others unlocked
CMPT 120 Full Course Notes
29
CMPT 120 Full Course Notes
Verified Note
29 documents

Document Summary

Basic: what"s (cid:373)ost popular: simply propose the most popular. Advanced: people like you also like: a field that allows us to predict the future, \n = new line. Loops: one big usage is to avoid code duplication, avoid copy/paste, for . I(cid:374: on every loop iteration, the variable takes on the value of items in the list you designated it to. Notes: str = designating a string when printing it with something else, range = expands to a list of numbers from 0 to range minus 1, example: loop with list of numbers, string, example (cid:862)hello(cid:863) Integer or int: example (cid:862) 7(cid:863, float.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents