Language Semantics
The Python language design is distinguished by its emphasis on readability, simplicity, and explicitness
Indention and not Braces
Python uses whitespace (tabs or spaces) to structure code instead of using braces as in many other languages like R, C++, Java, and Perl. A colon denotes the start of an indented code block after which all of the code must be indented by the same amount until the end of the block
Variables and Arguments Passing
When assigning a variable (or name) in Python, you are creating a reference to the object shown on the righthand side of the equals sign. Consider a list of integers.
In some languages, the assignment of b will cause the data [1, 2, 3] to be copied. In Python, a and b actually now refer to the same object, the original list [1, 2, 3]
Python has several built-in keywords for conditional logic, loops, and other standard control flow concepts found in other programming languages.
If, elif, else
The if statement is one of the most well-known control flow statement types. It checks a condition that, if True, evaluates the code in the block that follows
An if statement can be optionally followed by one or more elif blocks and a catchall else block if all of the conditions are False
for loops are for iterating over a collection (like a list or tuple) or an iterater. The standard syntax for a for loop is:
for value in collection: do something with value
While Loop
A while loop specifies a condition and a block of code that is to be executed until the condition evaluates to False or the loop is explicitly ended with break
Range
Enumerate
%formatting %d - integer %g - scientific %f - floating number %0.2f - 2 decimal places %s - string