Please enable JavaScript.
Coggle requires JavaScript to display documents.
Python - Coggle Diagram
Python
Basics
Functions
def function_name(arguments)
They are a way to avoid having to repeat yourself: if you need to do a series of operations repeatedly, just set up a function and call it each time you need to do it again.
Built-in functions
print(*objects, sep=' ', end='\n', file=sys.stdout, flush = False)
Prints the output.
print(a,b)
outputs two objects separated by a space by default.
-
Data types
Variables
These store data; can be on any side of the = sign, so:
a = 10
and
10 = a
are functionally the same thing.
Strings
These store a bunch of symbols
The symbols are treated as a list: they can be iterated through and can be accessed using slicing:
if
a = 'hello'
then
print(a[o])
displays 'h'.
Strings can be concatenated or joined together using the + sign; this does not put any spaces between them.
-
-
-