• Computers and programs (chapter 1 of the textbook)
• Python basics: variables, expressions, data types, comments, etc.
• Control flows: conditional, iteration, exceptions
• Functions: function definition and call, arguments, return values
• common build-in functions: print, len, int, float, str, bool, etc.
• standard library: string, file I/O, math, random
• Data structures: list, tuple, set
• OOP (object-oriented programming): class, object, etc.
• Algorithm: recursion, search, sort, efficiency, computability
★ Variables and Expressions
Variable 변수: named memory location, it contains a value
Assignment : ‘=’ symbol indicates assignment
r=10 → r is variable, the value of r is 10
r=10 → r is assigned the value of 10
Variable Name Rules
1. Must start with a letter or underscore _
2. Must consist of letters and numbers and underscores
3. Case Sensitive
• Good: spam eggs spam23 _speed
• Bad: 23spam #sign var.12
• Different: spam Spam SPAM
You cannot use reserved words as variable names / identifiers
reserved words: and del for is raise assert elif from lambda return break
else global not try class except if ...
★ expression and statement
Difference → Expression will be evaluated to a value,
but a statement will not be evaluated to a value.
ex) expressions: 1+1, ‘a’*3, 1
ex) statements: x=1, y =2, z=3
Numeric expressions
+ – * / **(제곱) %(나머지)
계산순서 ↓