Class Notes (838,669)
Canada (511,033)
CSCA20H3 (25)
Lecture

old stuff.docx

3 Pages
110 Views
Unlock Document

Department
Computer Science
Course
CSCA20H3
Professor
Benj Hellie
Semester
Winter

Description
How to return the length or sum of a list providing 3 different methodso 1 sumlist o 2by running a for loopo Note the layourt of the result can be different depending on how you write your print section in the for loopo If you want one number a linethen a12345sum0for single in asumsingle oprint sumo If youw ant all numbers in the same line then Print sum o If youw ant all numbers in the same line but with a tab in betweenthen Print strsum tNote you need to convert the suman integer into string first o One number on a line is the same as Print strsum n o 3 by defining a function and use return instead of print as the last stepo def findlenx o
More Less

Related notes for CSCA20H3

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit