forked from inspirezonetech/TeachMePythonLikeIm5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreating-variables.py
More file actions
24 lines (19 loc) · 805 Bytes
/
creating-variables.py
File metadata and controls
24 lines (19 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# ------------------------------------------------------------------------------------
# Tutorial: using variables in python
# ------------------------------------------------------------------------------------
# there's no need to declare variables in python. simply use them
# integers
a = 1
b = 2
print(a + b)
# strings
c = 'hello'
d = 'world'
print(c + d)
# bonus: you can check the type of a variable using the type() function
print(type(a))
print(type(c))
# ------------------------------------------------------------------------------------
# Challenge: 1. create an integer holding the number 7 and print the integer
# 2. create a string holding the sentence "I'm learning python" and print the string
# -------------------------------------------------------------------------------------