1
1
### Variables
2
- - A variable is a symbolic type associated with a value.
2
+ - A variable is a name associated with a value.
3
3
- A variable can be named anything, but it has some rules:
4
4
1 . It cannot start with an integer
5
5
2 . It cannot contain spaces
@@ -24,6 +24,10 @@ Examples of variable names:
24
24
` $current `
25
25
` response# `
26
26
27
+ ** Extra resources**
28
+
29
+ - [ What are variables?] ( https://python.tecladocode.com/1_age_program/2_variables.html#what-are-variables )
30
+
27
31
### Strings
28
32
A string is a sequence of characters surrounded by quotation marks:
29
33
- Single quotes ` '' `
@@ -54,7 +58,13 @@ Examples:
54
58
55
59
` "Same as this one' `
56
60
57
-
61
+ ** Extra resources**
62
+ - [ Strings and numbers] ( https://python.tecladocode.com/1_age_program/1_strings_numbers.html )
63
+ - [ String formatting] ( https://python.tecladocode.com/1_age_program/4_string_formatting.html#what-is-string-formatting )
64
+ - [ Strings, Variables, and Getting Input from Users] ( https://www.teclado.com/30-days-of-python/python-30-day-2-strings-variables )
65
+ - [ Formatting Strings and Processing User Input] ( https://www.teclado.com/30-days-of-python/python-30-day-3-string-formatting )
66
+ - [ Formatting Numbers for Printing in Python] ( https://blog.teclado.com/python-formatting-numbers-for-printing/ )
67
+ - [ Nested String Interpolation in Python] ( https://blog.teclado.com/python-nested-string-interpolation/ )
58
68
59
69
### Integers
60
70
An integer is a whole number of any length that can be positive or negative, written without a fractional element.
@@ -63,31 +73,26 @@ Example:
63
73
64
74
` -1 ` ` 0 ` ` 1 ` ` 2 ` ` 3 ` ` 86400 `
65
75
76
+
66
77
### Floats
67
78
A float is a number that can be positive or negative written with a fractional element.
68
79
69
80
Example:
70
81
71
82
` -100.54 ` ` 1.0 ` ` 59.1 ` ` 10.99 `
72
83
73
- ### Booleans
74
- Computers only understand binary — ` 1's ` and ` 0's ` .
84
+ ** Extra resources **
85
+ - [ Numbers, Arithmetic, and Printing to the Console ] ( https://www.teclado.com/30-days-of-python/python-30-day-1-numbers-printing )
75
86
76
- This way we can determine if a value is ` True ` or ` False ` .
87
+ ### Booleans
88
+ In Python booleans are a bool data type having two values:
77
89
78
- Strings, integers and other data types can indicate a boolean value.
90
+ ` True `
79
91
80
- Data types representing False bool:
81
- - Empty string: ` '' `
82
- - Empty list: ` [] `
83
- - Zero int: ` 0 `
84
- - Zero float: ` '0.0' `
92
+ ` False `
85
93
86
- Data types representing True bool:
87
- - A non-empty string: ` "This string" `
88
- - A list populated with at least one element: ` [100, 55] `
89
- - An integer higher than zero: ` 1 `
90
- - A float of which decimal number is higher than zero: ` 0.1 `
94
+ ** Extra resources**
95
+ - [ Conditionals and Booleans] ( https://www.teclado.com/30-days-of-python/python-30-day-5-conditionals-booleans )
91
96
92
97
### Lists
93
98
- A list is an ordered sequential data type
@@ -110,7 +115,10 @@ Data types representing True bool:
110
115
111
116
` shopping_list[2] # cherries `
112
117
113
-
118
+ ** Extra resources**
119
+ - [ What is a list?] ( https://python.tecladocode.com/2_countries_visited/1_lists.html )
120
+ - [ Split, join, and slices] ( https://www.teclado.com/30-days-of-python/python-30-day-7-split-join )
121
+ - [ Extending Python Lists] ( https://blog.teclado.com/python-extending-lists/ )
114
122
115
123
### Tuples
116
124
- A tuple is very much like a list, however:
@@ -128,13 +136,20 @@ Example:
128
136
129
137
` better_readability = ('with', 'parenthesis') `
130
138
139
+ ** Extra resources**
140
+ - [ Basic Python Collections] ( https://www.teclado.com/30-days-of-python/python-30-day-4-lists-tuples )
141
+
131
142
### Sets
132
143
- A set is an ** unordered** data type
133
144
- Elements of a set cannot be accessed by their indices
134
145
- A set is created by a single pair of curly brackets:
135
146
136
147
` shopping_list = {'apples', 'milk', 'cherries'} `
137
148
149
+ ** Extra resources**
150
+ - [ Sets] ( https://www.teclado.com/30-days-of-python/python-30-day-11-sets )
151
+ - [ Python Set Operators] ( https://blog.teclado.com/python-set-operators/ )
152
+
138
153
### Dictionaries
139
154
- A dictionary is created by 3 key components:
140
155
curly braces, keys and values
@@ -147,4 +162,8 @@ employees = {'ID': 16915, 'name': 'James', 'department': ['Sales', 'Accounting']
147
162
```
148
163
149
164
- A dictionary is accessed by keys as such:
150
- ` employees['name'] # 'James' `
165
+ ` employees['name'] # 'James' `
166
+
167
+ ** Extra resources**
168
+ - [ What is a dictionary?] ( https://python.tecladocode.com/2_countries_visited/1_lists.html )
169
+ - [ Updating Python Dictionaries] ( https://blog.teclado.com/python-updating-dictionaries/ )
0 commit comments