Answers for "python function how to take in any number of arguments"

0

craeting a method that can take any number of arguments in python

def my_min(*args):
    result = args[0]
    for num in args:
        if num < result:
            result = num
    return result

my_min(4, 5, 6, 7, 2)
Posted by: Guest on March-22-2021
0

craeting a method that can take any number of arguments in python

def kwargs_iterate(**kwargs):
    for i, k in kwargs.items():
        print(i, '=', k)

kwargs_iterate(hello='world')
Posted by: Guest on March-22-2021

Code answers related to "python function how to take in any number of arguments"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language