Busy. Please wait.
or

show password
Forgot Password?

Don't have an account?  Sign up 
or

Username is available taken
show password

why


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
We do not share your email address with others. It is only used to allow you to reset your password. For details read our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.

Remove ads
Don't know
Know
remaining cards
Save
0:01
To flip the current card, click it or press the Spacebar key.  To move the current card to one of the three colored boxes, click on the box.  You may also press the UP ARROW key to move the card to the "Know" box, the DOWN ARROW key to move the card to the "Don't know" box, or the RIGHT ARROW key to move the card to the Remaining box.  You may also click on the card displayed in any of the three boxes to bring that card back to the center.

Pass complete!

"Know" box contains:
Time elapsed:
Retries:
restart all cards




share
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

44-141Functions

Learning Functions with Python Programming

QuestionAnswer
a named sequence of instructions that are grouped together to perform a task function
A function is useful because it allows the programmer to organize their code by breaking it down into smaller pieces? True
When a function is called, additional information may be needed called a(n) argument
A function that returns a value is called a value returning function
A function that does not return a value is called a non-value retruning function
In the following code what is the name of the function: def addName(name: str) -> None: addName
In the following code what is the parameter: def addName(name: str) -> None: name
In the following code what is returned by the function: def addName(name: str) -> None: nothing (None)
In the following code, how many parameters are there: def findMin(num1: int, num2: int, num3: int) -> int: 3 (num1, num2, num3)
In the following code what data type is parameter 1: def findMin(num1: int, num2: int, num3: int) -> int: int
In the following code, what is returned by the function: def findMin(num1: int, num2: int, num3: int) -> int: int
What is the keyword used to define a function? def
What contains information about how a function will work and be called? function header
What receives and argument when the function is called? parameter
A function can have more then one return statement? True (as long as only one return statement can be reached, such as an if/else structure)
A function can return more then one value? False
The function header consists of the function identifier and arguments? False
The functions signature consists of the function identifier and arguments. True
The function header consists of the function identifier, list or formal parameters, and return type if denoted. True
In the following code what is the argument: addName("Jane") Jane
Write a function called averagePay that will return the average pay of type float of an employee over a number of weeks. The function should have 2 parameters totalPay of type float and numOfWeeks of type int. Include function annotations in your answer. def averagePay(totalPay: float, numOfWeeks: int) -> float: return totalPay / numOfWeeks
What is the function signature of the following function: def maxValue(pay1: float, pay2: float) -> float: maxValue(float, float)
What is the function signature of the following code: def sayHello() -> None: sayHello()
What are the function parameters of the following code: def sayHello() -> None: no parameters
Created by: dianarNW