CAS CS 111 Lecture Notes - Lecture 4: Docstring

186 views9 pages
Verified Note

Document Summary

A list is a sequence of arbitrary values (the list"s elements). A list can include values of different types: List ops == strings ops (more or less) For a string, both slicing and indexing produce a string: Indexing produces a single element - may or may not be a list. Extra practice: fill in the blank to make the code print "compute!" Once we define a function, we can call it: Write the function(s) is an editor window (file to new window). File to save and run to run module (or f5) See the recommended screen layout in the first in-class lab. Always use a docstring to explain what the function does. Surrounded by triple quotes, beginning on the second line. Other (non-docstring) comments can be included as needed. Function and function call in the same file. Defines two functions, but only gets called when we run in the program.

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