Simple For Loop Will output: 1 2 3 4 Reverse Loop Will output: 5 4 3 2 1 0 Nested For Loops For loop – Each item in a collection For loop – Range For loop by index Loop Control Exit loop Exit and start next iteration
All posts by
Zip() function
The zip function can be used to combine two lists together into a zip object. What it actually does is create tuples (an immutable type of list).
.Tuple
A tuple is an immutable type of list that python provides
Multidimensional lists
Create multidimension list Python lists can contain a different list for any time, so you can create lists as nested as you like! Access list items Manipulate multidimensional lists Remove sub item
Debug lists
Output to console
.List general
Create a list Multiple data types A list can contain different data types Adding to a list Accessing list elements Multi dimension lists See here Read list items Get a slice of list items Manipulate lists Add list items Joins 2 lists / concatenate Remove list item Length Sort List You can sort values and […]
if
Multiline if Not a problem, you can use whitespace as in C as long as you use surrounding brackets for the whole if statement: Boolean operators NOT Equal Logical AND Logical OR
True / False
Input from console
Using Strings-Values
Print a numeric variable Insert value strings into a string Decimal places For a float value For an integer value Convert string to value See here