python function keyword arg

Solutions on MaxInterview for python function keyword arg by the best coders in the world

showing results for - "python function keyword arg"
Diego
16 Feb 2017
1def greet(*names):
2    """This function greets all
3    the person in the names tuple."""
4
5    # names is a tuple with arguments
6    for name in names:
7        print("Hello", name)
8
9
10greet("Monica", "Luke", "Steve", "John")
Dimitri
29 Feb 2019
1# 2 keyword arguments
2greet(name = "Bruce",msg = "How do you do?")
3
4# 2 keyword arguments (out of order)
5greet(msg = "How do you do?",name = "Bruce") 
6
71 positional, 1 keyword argument
8greet("Bruce", msg = "How do you do?")