(Lecture 1) Abstraction, Hello Python, Memory Models
(Lecture 1) Abstraction, Hello Python, Memory Models
• Data Science
• Drawing useful conclusions from data using computation
• Computer Science
• Making computers do what you want to do efficiently (for your productivity)
1
Computing Bootcamp SNU Graduate School of Data Science 1
Computing Bootcamp
Abstraction
Lecture 1-1
Hyung-Sin Kim
Interface
Implementation
• They just need to deal with user interfaces, such as handle and pedals
• Once they know how to handle interfaces, they can drive all of various cars in the
world
https://www.youtube.com/watch?v=CS4cs9xVecg&list=
PLkDaE6sCZn6Ec-XTbcX1uRg2_u4xOEky0
Interface
Operating
System
Implementation
Hardware
Hardware
Interface
Operating
System
Implementation
Hardware
• If you are not writing an OS, you don’t need to care about hardware but OS
• Some smartphone Apps support either Android or iOS, not both of them
• Once an app is ported on Android, it works for all different kinds of Android
phones
• Execute a program called a shell, and type Python statements one at a time
• The interpreter will execute each statement when you type it
• With the Python interpreter, you only care about Python, neither OS nor
hardware
Operating System
• Python Interpreter
Hello, Python!
Lecture 1-2
Hyung-Sin Kim
• Let’s type a simple mathematical expression and execute the code (press
Ctrl+Enter or click Run)
• >>> 3 + 4
• 7
• Evaluation: When you type an expression and run it, Python evaluates
the expression, produces a value, and shows it
• Type whatever mathematical expressions for fun and see how Python
evaluates them!
• An expression having an int and a float makes Python convert the int to a
float
• 100 - 25.0 75.0
• Finite precision: Computer does not represent all the real numbers due to
its limited memory, representing the closest value it can produce
• 2/3 0.66666666666
• This is memory efficient and allows fast calculation
• Example
• max(2,3)
• Operators: max – a function name
• Operands: 2 and 3 – again, values that an operator takes
• Name
• Letters, digits, and the underscore symbol
• Cannot start with a digit: 7ab
• Case sensitive: GSDS vs. gsds
• No empty space
• Naming properly is very important! value
• Assignment
Hyung-Sin Kim
• Example
• The object at the memory address id1 has type float and the value 31.0
• The object at the memory address id2 has type function and max
31.0 max()
• “Hyung-Sin Kim”
advisor 942-416
• “Hyung-Sin Kim”
• >>> advisor = “Minhwan Oh”
advisor 942-416
• “Hyung-Sin Kim”
• >>> advisor = “Minhwan Oh”
advisor 942-419
942-416
942-419
• A variable points at the memory box where its assigned values lives