145,914 views
11 votes
11 votes
In Python, a function is _____.

a group of instructions that can be used to organize a program or perform a repeated task

a value that can be passed back to the calling part of a program

a formula that pairs each x-value with a unique y-value

a value that can be passed

User Bigflow
by
3.2k points

1 Answer

12 votes
12 votes

Answer:

a group of instructions that can be used to organize a program or perform a repeated task

Step-by-step explanation:

A function is a group of commands that can be called upon with extra parameters if needed.

Example:

def foo(): #defining this function and naming it foo

return True #what is performed when foo is called on

if foo() == True: #foo() is calling on a function named foo

print('yes')

User Yellowantphil
by
3.2k points