How to call a function

function.py


#say_hello()Calling before defining a function will result in an error
def say_hello():
    print('Hi!')

def add(a, b):
    return a+b

say_hello()
print(add(10,20))

Output result

Hi!
30

Recommended Posts

How to call a function
[Go] How to write or call a function
How to make a recursive function
[Python] How to call a c function from python (ctypes)
How to create a function object from a string
How to Mock a Public function in Pytest
How to hack a terminal
How to make a Japanese-English translation
Call a Python function from p5.js.
How to write a Python class
How to use the zip function
How to put a symbolic link
How to make a slack bot
How to create a Conda package
How to make a crawler --Advanced
How to create a virtual bridge
Python-dynamically call a function from a string
How to make a deadman's switch
How to create a Dockerfile (basic)
[Blender] How to make a Blender plugin
How to delete a Docker container
How to make a crawler --Basic
How to use python zip function
How to create a config file
How to call PyTorch in Julia
How to use the __call__ method in a Python class
How to print characters as a table with Python's print function
How to create a clone from Github
How to split and save a DataFrame
[Road to Python Intermediate] Call a class instance like a function with __call__
How to build a sphinx translation environment
How to create a git clone folder
Qiita (1) How to write a code name
How to add a package with PyCharm
[Python] How to make a class iterable
How to draw a graph using Matplotlib
[Introduction to Python] How to split a character string with the split function
[Python] How to convert a 2D list to a 1D list
[Python 3.8 ~] How to define a recursive function smartly with a lambda expression
[python] How to use __command__, function explanation
[Colab] How to copy a huge dataset
[Python] How to invert a character string
How to install a package using a repository
[Ubuntu] How to execute a shell script
A simple IDAPython script to name a function
How to get a stacktrace in python
Is R's do.call () a classical higher-order function? Learn how to use
How to create a repository from media
How to make a Backtrader custom indicator
How to choose a Seaborn color palette
How to test on a Django-authenticated page
How to make a Pelican site map
How to run a Maya Python script
How to call a POST request that supports Japanese (Shift-JIS) with requests
How to divide and process a data frame using the groupby function
[Python] Explains how to use the range function with a concrete example
How to call when using double underscore (Private attribute) for class function
How to create a wrapper that preserves the signature of the function to wrap
[Introduction to Python] How to write a character string with the format function
How to make a dialogue system dedicated to beginners
How to read a CSV file with Python 2/3