I&C SCI 31 Lecture 4: 10.14.14

32 views3 pages

Document Summary

# ics 31, tuesday, october 14, 2014, 11am. How we talk about programming languages and their features. Evaluate the expression and put its value into the box/variable named on the left side of the = sign. We"ve seen a variety of predefined functions: len() sum() int() print() -- doesn"t have a return value; just a side effect (of printing) input() -- doesn"t require any arguments. # here we call the function len() with the argument/parameter/input. # len() computes the length and returns the value. # so python now thinks of this line as print(5) # now we call print() with the result of len(), printing out 5. You have what"s built in/predefined, and you can build new things. With data, we can build new types with namedtuples. With operations, we can build new operations by defining functions. Actions / verbs / statements, operators, functions, methods / control: def double (n: int) -> int:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents