Cheat Sheet Python
def foo():
"""
This is a function docstring
You can also use:
''' Function Docstring '''
"""
DevLorenzo
def foo():
"""
This is a function docstring
You can also use:
''' Function Docstring '''
"""
a = 1 # initialization
>>> spam = 'Hello'
>>> spam
'Hello'
>>> print('Hello world!')
Hello world!
>>> print('What is your name?') # ask for their name
>>> myName = input()
>>> print('It is good to meet you, {}'.format(myName))
What is your name?
Al
It is good to meet you, Al
# This is a
# multiline comment
>>> a = [1, 2, 3]
>>> if a:
>>> print("the list is not empty!")
>>> 'Alice' 'Bob'
'AliceBob'
>>> _spam = 'Hello'
>>> str(-3.14)
'-3.14'