##1.Write a function named shout. The function should accept a string argument
##and display it in uppercase with an exclamation mark concatenated to the end.
##
##2. Examine the following function header, then write a statement that calls
##the function, passing 12 as an argument.
##def show_value(quantity):
##3. Look at the following function header:
##def my_function(a, b, c):
##Now look at the following call to my_function:
##my_function(3, 2, 1)
##When this call executes, what value will be assigned to a? What value will be
assigned
##to b? What value will be assigned to c?
1)
def shout(string):
print(string.upper()+"!");
shout("hello")
Expected output:
2)
def show_value(quantity):
print(quantity);
show_value(12);#passing 12 as argument to show_value function
Expected output:
12
3)
def my_function(a,b,c):
print("a ="+str(a)+" b ="+str(b)+" c ="+str(c));
my_function(3,2,1);
Expected output:
a =3 b =2 c =1
The function header says that the values of a,b,c will be 3,2,1 because in whatever order the parameters are passed in a function call the same order will be used for assigning the variables in the function .
Get Answers For Free
Most questions answered within 1 hours.