what does * mean in python in functions code example
Example 1: python functions
def function():
print('This is a basic function')
function()
// Returns 'This is a basic function'
def add(numA, numB):
print(numA+numB)
add(1,2)
// Returns 3
def define(value):
return value
example = define('Lorem ipsum')
print(example)
// Returns 'Lorem ipsum'
Example 2: python funtion
def nameOfFunction(something):
return something
Example 3: what does * mean in python in functions
>>> numbers = [2, 1, 3, 4, 7]
>>> more_numbers = [*numbers, 11, 18]
>>> print(*more_numbers, sep=', ')
2, 1, 3, 4, 7, 11, 18