Study Guides (247,961)
CMPT 120 (36)

# Unit 2 & 3.docx

1 Page
123 Views

School
Department
Computing Science
Course
CMPT 120
Professor
Diana Cukierman
Semester
Fall

Description
Unit 2 Value – a letter or number  Integer – whole numbers  String – a “string” of letters enclosed in quotation marks Floating-point – numbers with a decimal point Operators – special symbols that represent computations (+, -) Expression – combination of values, variable and operators Statement – a unit of code that Python can execute. (Print & Assignment)  Expression has a value; statement does not. PEMDAS – Order of operations within Python  Parentheses 2 * (3-1) = 4  Exponentiation 3*1**3 = 3, not 27  Multiplication 2*3-1 = 5, not 4  Division 6+4/2 = 8, not 5  Addition 5-1+2 = 2, not 6  Subtraction 4-3 = 1 Concatenation – joining strings by linking them end to end  Example: first = “throat” second = “warbler” >>> print first + second throatwarbler Unit 3 Function – name of a sequence of statements that performs a computation Function call – when you “call” the function by name  Example: >>> type (32)  Argument – a value provided to a function  Return value – the result of an argument int – takes any value and
More Less

Related notes for CMPT 120
Me

OR

Join OneClass

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

Join to view

OR

By registering, I agree to the Terms and Privacy Policies
Just a few more details

So we can recommend you notes for your school.