CISC 121 Lecture : 3.1.pdf

74 views1 pages
wunch and 39345 others unlocked
CISC 121 Full Course Notes
35
CISC 121 Full Course Notes
Verified Note
35 documents

Document Summary

Zero or greater elements (can be empty) indexed from position 0 to length-1 my_list = [4, 6, 3, 9] print mylist[2] -> output = 3. List elements don"t have to be the same type. Adds dog to end of list, making it 1 item larger. Play a number guessing game with the user-> 1. choose a secret number a. choose a random number in the range 1 to 100. 2. have the user enter guesses until the number is guessed a. b. Set a limit on maximum number of guesses while the number has not been guessed and the max number of guesses has not been exceeded i. ii. iii. iv. Get the user"s next guess increment the number of guesses used so far add new guess to list of guesses give the user a hint based on their guess. 3. print the guesses made a. print the list of the user"s guesses.

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