Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


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.
Your email address is only used to allow you to reset your password. See 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.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
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
Popular Computers sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards