Skip to content

Commit d2c8304

Browse files
authored
Merge pull request #8 from beneyal/main
Update `python_basics.ipynb`
2 parents 2358640 + 2f0789e commit d2c8304

File tree

2 files changed

+50
-57
lines changed

2 files changed

+50
-57
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.ipynb_checkpoints

python_basics.ipynb

Lines changed: 49 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5+
"id": "923a2839",
6+
"metadata": {},
7+
"source": [
8+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/zero-to-mastery/Complete-Python-Developer-Manual/blob/main/python_basics.ipynb)"
59
"id": "a223de83",
610
"metadata": {},
711
"source": [
@@ -13,43 +17,31 @@
1317
"id": "6a723c1e",
1418
"metadata": {},
1519
"source": [
16-
"- Python Basics\n",
17-
"- Learning Python\n",
18-
"- Python Data Types\n",
19-
"- How to Succeed\n",
20-
"- Numbers\n",
21-
"- Math Functions\n",
22-
"- DEVELOPER FUNDAMENTALS I\n",
23-
"- Operator Precedence\n",
24-
"- Optional: Bin and Complex\n",
25-
"- Variables\n",
26-
"- Expressions vs. Statements\n",
27-
"- Augmented Assignment Operator\n",
28-
"- Strings\n",
29-
"- String Concatenation\n",
30-
"- Type Conversion\n",
31-
"- Escape Sequence\n",
32-
"- Formatted Strings\n",
33-
"- String Indexes\n",
34-
"- Immutability\n",
35-
"- Built-in Functions and Methods\n",
36-
"- Booleans\n",
37-
"- DEVELOPER FUNDAMENTALS II\n",
38-
"- Lists\n",
39-
"- List Slicing\n",
40-
"- Matrix\n",
41-
"- List Methods\n",
42-
"- Common List Patterns\n",
43-
"- List Unpacking\n",
44-
"- None\n",
45-
"- Dictionaries\n",
46-
"- DEVELOPER FUNDAMENTALS III\n",
47-
"- Dictionary Keys\n",
48-
"- Dictionary Methods\n",
49-
"- Dictionary Methods 2\n",
50-
"- Tuples\n",
51-
"- Sets\n",
52-
"- Sets 2"
20+
"# Complete Python Developer: Zero to Mastery - Python Basics\n",
21+
"\n",
22+
"## Table of Contents\n",
23+
"\n",
24+
"* [Learning Python](#learning-python)\n",
25+
"* [Python Data Types](#python-data-types)\n",
26+
"* [How to Succeed](#how-to-succeed)\n",
27+
"* [Numbers](#numbers)\n",
28+
"* [Math Functions](#math-functions)\n",
29+
"* [DEVELOPER FUNDAMENTALS I](#developer-fundamentals-i)\n",
30+
"* [Operator Precedence](#operator-precedence)\n",
31+
"* [Bin and Complex](#bin-and-complex)\n",
32+
"* [Variables](#variables)\n",
33+
"* [Expressions vs. Statements](#expressions-vs-statements)\n",
34+
"* [Augmented Assignment Operator](#augmented-assignment-operator)\n",
35+
"* [Strings (`str`)](#strings-str)\n",
36+
"* [String Concatenation](#string-concatenation)\n",
37+
"* [Type Conversion](#type-conversion)\n",
38+
"* [Escape Sequence](#escape-sequence)\n",
39+
"* [Formatted Strings](#formatted-strings)\n",
40+
"* [String Indexes](#string-indexes)\n",
41+
"* [Immutability](#immutability)\n",
42+
"* [Built-In Functions and Methods](#built-in-functions-and-methods)\n",
43+
"* [Booleans](#booleans)\n",
44+
"* [DEVELOPER FUNDAMENTALS II](#developer-fundamentals-ii)"
5345
]
5446
},
5547
{
@@ -71,22 +63,22 @@
7163
"metadata": {},
7264
"source": [
7365
"## Python Data Types\n",
74-
"We will use [Repl.it](https://replit.com/) to write our first Python code so we don't have to worry about installation at first.\n",
66+
"We will use [repl.it](https://replit.com/) to write our first Python code so we don't have to worry about installation at first.\n",
7567
"\n",
7668
"Python has several data types. We'll list them out and then discuss them individually. Notice that the REPL will highlight these data types, which clues us in that there is something special about them.\n",
7769
"\n",
7870
"A data type represents a value in Python, and writing a program allows us to take actions on these data types. Examples of actions include creating, changing/manipulating, storing, and removing data types.\n",
7971
"\n",
8072
"Python Data Types:\n",
81-
"- int: integer (a whole number)\n",
82-
"- float: floating point number\n",
83-
"- bool: boolean\n",
84-
"- str: string\n",
85-
"- list\n",
86-
"- tuple\n",
87-
"- set\n",
88-
"- dict\n",
89-
"- None: the absence of value\n",
73+
"- `int`: integer (a whole number)\n",
74+
"- `float`: floating point number\n",
75+
"- `bool`: boolean\n",
76+
"- `str`: string\n",
77+
"- `list`\n",
78+
"- `tuple`\n",
79+
"- `set`\n",
80+
"- `dict`\n",
81+
"- `None`: the absence of value\n",
9082
"\n",
9183
"We can also create our own custom data types using something called classes. We'll explore how to do this later in the course.\n",
9284
"\n",
@@ -176,7 +168,7 @@
176168
"id": "c7c7f051",
177169
"metadata": {},
178170
"source": [
179-
"There are specific math functions built into Python that we can use on integers and floating point numbers. Functions are actions we can take on data, such as print() and type(). Try the following out in your REPL.\n",
171+
"There are specific math functions built into Python that we can use on integers and floating point numbers. Functions are actions we can take on data, such as `print()` and `type()`. Try the following out in your REPL.\n",
180172
"\n",
181173
"See this article on [Python Mathematical Functions](https://www.programiz.com/python-programming/modules/math) for more and try Googling for Python math functions as well. Also, keep in mind that you'll never need all of the math functions in Python. We'll go over some of the important once in this course."
182174
]
@@ -257,7 +249,7 @@
257249
"## Bin and Complex\n",
258250
"There is an extra data type we didn't discuss. It's called complex and is a third type of number. We won't focus on it because it's only significant if we're doing complicated math.\n",
259251
"\n",
260-
"Integers and floats get stored as binary numbers. There is an action called bin that we can use to return a binary representation of an integer."
252+
"Integers and floats get stored as binary numbers. There is an action called `bin` that we can use to return a binary representation of an integer."
261253
]
262254
},
263255
{
@@ -301,9 +293,9 @@
301293
"* Make variable names descriptive\n",
302294
"\n",
303295
"Other things to be aware of:\n",
304-
"* Constants should be in capitals, i.e., PI = 3.14\n",
296+
"* Constants should be in capitals, i.e., `PI = 3.14`\n",
305297
"* There are dunder variables that start with two underscores that should not be assigned\n",
306-
"* Underscore in Python singnifies a private variable (_user_iq)"
298+
"* Underscore in Python singnifies a private variable (`_user_iq`)"
307299
]
308300
},
309301
{
@@ -355,7 +347,7 @@
355347
"## Expressions vs. Statements\n",
356348
"An expression is the right side of a statement. A statement is an entire line of code that performs some sort of action.\n",
357349
"\n",
358-
"As in the previous example, user_iq / 4 is an expression. user_age = user_iq / 4 and user_iq = 190 are statements."
350+
"As in the previous example, `user_iq / 4` is an expression. `user_age = user_iq / 4` and `user_iq = 190` are statements."
359351
]
360352
},
361353
{
@@ -364,7 +356,7 @@
364356
"metadata": {},
365357
"source": [
366358
"## Augmented Assignment Operator\n",
367-
"In the example below, some_value += 2 makes use of the augmented assignment operator."
359+
"In the example below, `some_value += 2` makes use of the augmented assignment operator."
368360
]
369361
},
370362
{
@@ -623,7 +615,7 @@
623615
"metadata": {},
624616
"source": [
625617
"## String Indexes\n",
626-
"str is an ordered sequence of characters that are stored in memory in same order and can be accessed by indeces."
618+
"`str` is an ordered sequence of characters that are stored in memory in same order and can be accessed by indices."
627619
]
628620
},
629621
{
@@ -668,7 +660,7 @@
668660
"source": [
669661
"## Immutability\n",
670662
"Strings are immutable in Python. If we reassign a string in Python, it will overwrite the original string.\n",
671-
"[start:stop:step] is string slicing."
663+
"`[start:stop:step]` is string slicing."
672664
]
673665
},
674666
{
@@ -677,7 +669,7 @@
677669
"metadata": {},
678670
"source": [
679671
"## Built-In Functions and Methods\n",
680-
"We have been learning about built-in functions that Python can take on data, such as str(), int(), type(), print(), and float(). Some resources for built-in functions are [Python String Methods](https://www.w3schools.com/python/python_ref_string.asp) [Built-in Functions](https://docs.python.org/3/library/functions.html)\n"
672+
"We have been learning about built-in functions that Python can take on data, such as `str()`, `int()`, `type()`, `print()`, and `float()`. Some resources for built-in functions are [Python String Methods](https://www.w3schools.com/python/python_ref_string.asp) [Built-in Functions](https://docs.python.org/3/library/functions.html)\n"
681673
]
682674
},
683675
{
@@ -810,7 +802,7 @@
810802
"metadata": {},
811803
"source": [
812804
"## DEVELOPER FUNDAMENTALS II\n",
813-
"As soon as Python sees a #, it adds a comment.\n",
805+
"As soon as Python sees a `#`, it adds a comment.\n",
814806
"\n",
815807
"Guidelines for comments:\n",
816808
"* When you comment your code, you're adding valuable content to help another programmer or yourself when you review it later.\n",

0 commit comments

Comments
 (0)