Hello Python
Hello Python
Hello Python
I N T R O D U C T I O N TO P Y T H O N
Hugo Bowne-Anderson
Data Scientist at DataCamp
How you will learn
INTRODUCTION TO PYTHON
Python
INTRODUCTION TO PYTHON
IPython Shell
Execute Python commands
INTRODUCTION TO PYTHON
IPython Shell
INTRODUCTION TO PYTHON
Python Script
Text les - .py
INTRODUCTION TO PYTHON
Python Script
INTRODUCTION TO PYTHON
Python Script
INTRODUCTION TO PYTHON
DataCamp Interface
INTRODUCTION TO PYTHON
Let's practice!
I N T R O D U C T I O N TO P Y T H O N
Variables and Types
I N T R O D U C T I O N TO P Y T H O N
Hugo Bowne-Anderson
Data Scientist at DataCamp
Variable
Speci c, case-sensitive name
1.79 m - 68.7 kg
height = 1.79
weight = 68.7
height
1.79
INTRODUCTION TO PYTHON
Calculate BMI
height = 1.79 68.7 / 1.79 ** 2
weight = 68.7
height
21.4413
weight
BMI = 21.4413
height2
21.4413
INTRODUCTION TO PYTHON
Reproducibility
height = 1.79
weight = 68.7
bmi = weight / height ** 2
print(bmi)
21.4413
INTRODUCTION TO PYTHON
Reproducibility
height = 1.79
weight = 74.2 # <-
bmi = weight / height ** 2
print(bmi)
23.1578
INTRODUCTION TO PYTHON
Python Types
type(bmi)
float
day_of_week = 5
type(day_of_week)
int
INTRODUCTION TO PYTHON
Python Types (2)
x = "body mass index"
y = 'this works too'
type(y)
str
z = True
type(z)
bool
INTRODUCTION TO PYTHON
Python Types (3)
2 + 3
'ab' + 'cd'
'abcd'
INTRODUCTION TO PYTHON
Let's practice!
I N T R O D U C T I O N TO P Y T H O N