“Аргументы функции Python” Ответ

Функция Python как аргумент

def sum(a,b):
    return a+b

def calculate(function,a,b):
    return function(a,b)

calculate(sum,3,4)
#returns 7
AartvB

Аргументы Python

import sys

print ("the script has the name %s" % (sys.argv[0])
Common Melba Finch

Аргументы функции Python

def greet(name, msg):
    """This function greets to
    the person with the provided message"""
    print("Hello", name + ', ' + msg)

greet("Monica", "Good morning!")
SAMER SAEID

Ответы похожие на “Аргументы функции Python”

Смотреть популярные ответы по языку

Смотреть другие языки программирования