CSCA08H3 Lecture 5: CSC108 - Week 5 Notes

202 views6 pages
1 Mar 2016
School
Course
Professor

Document Summary

Comments can be left with a # symbol. Python ignores the rest of this line, allowing us to leave comments and explanations of our code without it being executed or considered by. That"s pretty much it, he talks about a lot about a loop example for some reason but it all seems pretty intuitive to me. Check out the video if you"d like. https:// teach. cdf. toronto. edu/stg108/content/challenges/74/1: comments are intended for programmers so they shouldn"t explain how the code does, useful for explaining complicated bits of code. something, just the effect, relationships of variables, purpose, etc. So z > a), and sum(list) returns a typeerror: lists can contain both numbers and strings, for loops work for lists by considering one item at a time. For our grades example, the following code returns this: list methods. Remember methods are functions that belong to objects. List methods that modify the list: list. append(object) appends a function to the end of the list.

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