In: Computer Science
Please answer all qestions
1) Within a function header, for example:
def gcd(a, b):
The variables that appear within parentheses are called what?
Group of answer choices
a)variables
b)attributes
c)parameters
d)arguments
2)Question 31 pts
Within a function call, for example:
g = gcd(142, b);
The text that appears within parentheses is called what?
Group of answer choices
a) variables
b) attributes
c) parameters
d)arguments
3) Question 42 pts
Given this function header:
def compute(x, y, z):
And this code to call that function:
x = 7 result = compute(3, 2, x)
Within the function compute, what value will be stored in the parameter x ?
Group of answer choices
2
3
7
None of the above
4) Question 51 pts
What is wrong with the following function?
def area circle(radius): """Compute and return the area of a circle.""" area = math.pi * radius ** 2 return area
Group of answer choices
The function name includes a space character.
The function has no parameters.
The function redefines its parameter.
The function doesn't return a value.
5) Question 61 pts
What is wrong with the following function?
def kilometers_from_miles(miles): """Convert a value in miles to kilometers and return the kilometers value. """ miles = float(input("Please enter a distance in miles: ")) km = miles * 1.60934 return km
Group of answer choices
The function has no parameters.
The function redefines its parameter.
The function is too short.
The function doesn't return a value.
6) Question 71 pts
What is wrong with the following function?
def torus_volume(inner, outer): """Compute and return the volume of a torus.""" vol = 2 * (math.pi * inner) ** 2 * outer
Group of answer choices
The function has no parameters.
The function redefines its parameter.
The function is too short.
The function doesn't return a value.
PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU
NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU
AS I DONE MOST OF YOUR ANSWERS, THOUGH WE ARE ONLY ALLOWED TO
ATTEMPT ONE ANSWER OR FOUR SUB PARTS, PLEASE GIVE IT A THUMBS
UP
1) Within a function header, for example:
def gcd(a, b):
The variables that appear within parentheses are called what?
C) parameters
2) Within a function call, for example:
g = gcd(142, b);
The text that appears within parentheses is called what?
a) variables
3) Given this function header:
def compute(x, y, z):
And this code to call that function:
x = 7 result = compute(3, 2, x)
Within the function compute, what value will be stored in the parameter x ?
7
4)
What is wrong with the following function?
def area circle(radius): """Compute and return the area of a circle.""" area = math.pi * radius ** 2 return area
Group of answer choices
The function name includes a space character.
5)
What is wrong with the following function?
def kilometers_from_miles(miles): """Convert a value in miles to kilometers and return the kilometers value. """ miles = float(input("Please enter a distance in miles: ")) km = miles * 1.60934 return km
The function redefines its parameter.
6)
What is wrong with the following function?
def torus_volume(inner, outer): """Compute and return the volume of a torus.""" vol = 2 * (math.pi * inner) ** 2 * outer
The function doesn't return a value.