This repo is to document & create a tutorial to learn Python. Below is a list of useful links and definitions that may be of use. My focus is on the basics and branching out to work with data collection and analysis.
- Learn something new daily with a vast surplus of information & constant advancements in technology.
- Career is in high demand AKA high salary. Rewards are priceless even without the high salary.
- Flexibility to work remotely and save time on commutes.
- Freedom to pursue personal projects and improve quality of life.
- Community is enthusiastic to share wealth of knowledge with fellow developers.
- Get ready to be a master at Google. No need to memorize everything.
- Accept and embrace failure quickly. Avoid trying to be a perfectionist.
- Troubleshooting and debugging mistakes thoroughly to find a solution is important for learning.
- Type the code out until you feel comfortable enough to copy and paste. Practice makes perfect.
- You are essentially learning how to learn on the first go around.
- Be very specific in your questions and always research before asking.
- Write easy to read code and use proper indentation.
- Interpreted language that runs on Windows , Mac OS X, Linux, etc.
- Supports object-oriented, procedural, and functional programming.
- Supports basic data types such as strings and numbers and complex data types like lists and dictionaries.
- Strongly typed but is also dynamically typed, meaning you are freed from worrying about variable declarations.
- Open source, friendly, and simplistic but with a lot of power.
Python Landing Page
What is Python?
TOC
- Focus on programming concepts versus learning syntax.
- User-friendly documentation and installation.
- Developers contribute religiously to community by creating Python libraries.
Python Ebook
Python Docs
Standard Library Docs
- Google, Dropbox, Spotify all use Python.
- Allows for cross-platform compatibility.
- Suited for rapid delivery and maintenance.
- Python developers tend to have higher salaries than other languages.
- Client and server side capabilities.
- Used for machine learning, game engines, artificial intelligence and data science.
- Thousands of third-party modules
Personal preference but executable file download is the simplest option. Download and install Python based off your operating system and system type.
Choose and download the IDE of your choosing. I pay for JetBrains ItelliJ
because I love it.
IDE Download Options
A variable
is a name that refers to a value. An assignment
is the statement that assigns a value to a variable. A reserved location in memory to store a value(data) like a string or a number. In a program it gives data to the computer for processing.
# Examples
a = 10
greeting = 'Howdy'
pi = 3.1415926535897932
current_player = None
Types
A category of values.
Type | Value | Description |
---|---|---|
bool | True or False | Boolean |
float | 5.3 | Floating-point number |
int | 1 | Integer |
str | 'single' or "double" | String |
None | Absence of value |
Rules for Variable Names
- Must begin with a letter(upper or lower case) or an underscore_ character
- Can contain letters, numbers or underscore characters but can not begin with a number
- Case sensitive so example and Example refer to 2 different variables but by convention only lowercase letters are used.
- Underscore character is often used in names with multiple words.
- Variables are names/labels that are bound to a value with the use of =.
- Keywords can not be used as variable names. Reserved Keywords
Arithmetic
Operation | Symbol |
---|---|
Addition | + |
Subtraction | - |
Multiplication | * |
Division | / |
Floor Division | // |
Modulo(Remainder) | % |
Exponentiation | ** |
Operator Precedence
Parenthesis, Exponents, Multiplication / Division, Addition / Subtraction
- Multiplication and division have equal precedence.
- Addition and subtraction have equal precedence.
- If an expression contains operations of equal precedence, they're evaluated from left to right.
Strongly typed but is also dynamically typed, meaning you are freed from worrying about variable declarations. Python's built-in data types include:
-
numeric
Note: It is important to understand the difference in the different numeric types.
- Whole numbers with no fractional part or decimals.
- Computations using integers are significantly faster than using floating point numbers.
- Python 3 has no maximum size limitation for ints. You will run out of memory before you can can exceed the size limit.
- Python 2 used to have a long for large numbers but has been replaced by int in latest edition.
- Real numbers or numbers having a fractional part after the decimal.
- Max float value on 64 bit computer is 1.797e308 or move the decimal 308 places right.
- Minimum float value is 2.25e-308 or 307 zeros before the decimal point.
- 52 digits of precision generally enough, but if you require more precision you can use a Decimal data type.
- Contain a real and an imaginary part, based on square root of -1.
- More for advanced mathematics/engineering topics.
- WILL NOT be covered in this tutorial.
Muhammet Aydin Muhammet Aydin