File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## Variables
44
5- Variables are easy to understand. They simply ** contain data** . Actually
6- they [ point to data] ( https://www.youtube.com/watch?v=_AEJHKGk9ns ) , but
7- think about them as data containers for now.
5+ Variables are easy to understand. They simply ** point to data** .
86
97``` py
10- >> > a = 1 # create a variable called a and assign 1 to it
11- >> > a # get the value of a and let Python echo it
8+ >> > a = 1 # create a variable called a that points to 1
9+ >> > a # get the value that a points to
12101
1311>> >
1412```
1513
1614We can also change the value of a variable after setting it.
1715
1816``` py
19- >> > a = 2
17+ >> > a = 2 # make it point to 2 instead
2018>> > a
21192
2220>> >
@@ -47,6 +45,21 @@ use underscores.
4745>> >
4846```
4947
48+ Variable names are case-sensitive, like many other things in Python.
49+
50+ ``` py
51+ >> > thing = 1
52+ >> > THING = 2
53+ >> > thIng = 3
54+ >> > thing
55+ 1
56+ >> > THING
57+ 2
58+ >> > thIng
59+ 3
60+ >> >
61+ ```
62+
5063Python also has some words that cannot be used as variable names
5164because they have a special meaning. They are called ** keywords** , and
5265you can run ` help('keywords') ` to see the full list if you want to.
You can’t perform that action at this time.
0 commit comments