Answers for "how to make a function input optional in python"

0

how to make a function input optional in python

#*args makes it so that you can use any amount of variables
def function(variable1, variable2, *args):
#for example the print function can start with: def print(*args)
Posted by: Guest on August-06-2021
0

how to make a function input optional in python

# Define a default value to the variable.
def function(required_variable, optional_variable = "1"):
Posted by: Guest on August-06-2021

Code answers related to "how to make a function input optional in python"

Python Answers by Framework

Browse Popular Code Answers by Language