01:198:110 Lecture 18: Compu 11-1

64 views3 pages
Verified Note

Document Summary

Not on exam this week, will be on final. Can store multiple values all under the same variable name. Ex: variable = colors colors1 - blue colors2 - green colors3 - red. Operations on a list (found under variable - make a list): Traverse the items on a list - say every single item on the list (or every other item, every fifth item, etc. ) Insert items into a specific place in the list (add command adds to the end) Example of a list in scratch: add 10 random numbers to the list. List length found at bottom of items" list (pic to right) which would show on animation screen. Adding entries until sentinel value" encountered, be sure to add an if statement that ensures that ending value is not added to list (see below) Don"t want -1 in list: improbable value (for example if talking about test scores, or other scenarios where a given number/set of numbers is irrelevant)

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