Difference between revisions of "Python: def"
Jump to navigation
Jump to search
| Line 9: | Line 9: | ||
Define it: | Define it: | ||
def YourFirstFunction(): | def YourFirstFunction(): | ||
| − | print ("My first function") | + | [[print]] ("My first function") |
Use to execute it: | Use to execute it: | ||
Revision as of 01:37, 3 March 2022
def keyword to define a Python function
def lambda_handler(event, context):
Define it:
def YourFirstFunction(): print ("My first function")
Use to execute it:
YourFirstFunction()
def main()
def main():
# my code here
if __name__ == "__main__":
main()
Related terms
See also
- Python, PIP, Global interpreter lock (GIL), Flask, Django, Marshmallow,
def, logging, Pandas, Numpy, AWS Chalice,import,from,tuple,list, Python exceptions,virtualenv,.append,pytz,TZ,print,python3 -c,os, PEP, Python Institute, Methods: Dunder methods, Flake8, Python collections, Function decorators in Python, Click python library, Python module, Flower,kwargs, Black (Python), Python list structure, Mypy,variables, Casting,try:, pydoc, argparse, Anaconda,pyenv, setup.py, python3 --version, python3 --help, Data Classes, raise, glob
Advertising: