#Python basics (functions)

1. Function

A brief note about Python functions

#Function to multiply
def product(a, b):
    c = a * b
    return c

print(product(10,2))

[Output] 20

#Function to multiply
def product(a, b = 3):
    c = a * b
    return c

print(product(10))

[Output] 30

#Function to multiply
def product(a, b ,c):
    d = a * b * c
    return d

val = (10,2,3)
print(product(*val))

[Output] 60

Recommended Posts

#Python basics (functions)
Python basics: functions
# 4 [python] Basics of functions
Python basics ⑤
Python basics ④
Python functions
Python basics ③
Python basics
Python basics
Python basics
Python basics ③
Python basics ②
Python basics ②
Python basics: list
Python basics memorandum
#Python basics (#matplotlib)
Python basics: dictionary
Basics of Python ①
Basics of python ①
Python slice basics
#Python basics (scope)
#Python basics (#Numpy 1/2)
[Beginner] Python functions
Python array basics
Python profiling basics
Python Easy-to-use functions
Python #Numpy basics
#Python basics (class)
Python basics summary
Python Beginner's Guide (Functions)
Python basic course (12 functions)
Python: Unsupervised Learning: Basics
Basics of Python scraping basics
Python basics 8 numpy test
[Python] Memo about functions
Errbot: Python chatbot basics
#Python DeepLearning Basics (Mathematics 1/4)
Python basics: Socket, Dnspython
Python built-in functions ~ Zip ~
Wrap Python built-in functions
Basics of python: Output
Curry arbitrary functions with Python ....
Python> lambda> tiny functions / callback functions
Getting Started with Python Functions
Python3 programming functions personal summary
Python
Overriding library functions in Python
python: Basics of using scikit-learn ①
Python basics: conditions and iterations
Paiza Python Primer 4: List Basics
Keyword arguments for Python functions
Python for super beginners Python #functions 1
Paiza Python Primer 7: Understanding Functions
Python 3 sorted and comparison functions
Python functions learned in chemoinformatics
Basics of Python × GIS (Part 1)
Python higher-order functions and comprehensions
[Introduction to Data Scientists] Basics of Python ♬ Functions and classes
Python control syntax, functions (Python learning memo ②)
Basics of Python x GIS (Part 3)
Paiza Python Primer 5: Basics of Dictionaries