CSCI 1301 Lecture Notes - Lecture 4: Test Case, List Of Association Football Teams To Have Won Four Or More Trophies In One Season, Newline

18 views7 pages

Document Summary

Each value can be identified by its position in the list. Len() finds the number of items in a list. Listname[x] gives the value of the xth item in the list. Index = the item"s position in the list. Value = the value that goes with a specific index. Write a function that takes in a list and prints each item in that list on a separate lines. Conditionals are used when you want different things done depending on the input. Ex: a function that checks a person"s age before allowing them into a movie. We want to check if their age satisfies a requirement! If statements create their own code block (umbrella) which means that everything you want executed given that a particular condition is true, must be indented underneath the statement and have a colon! How it looks: if a == 5: Write a function that checks a person"s age.

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