1 Following Function Definition Call 3f Careful Def Showcuberoot X Ans X 10 30 Print Cube Q37092359

1. In the following function definition, whatdo we call ‘.3f’? (Careful!)

def show_cube_root(x):
       ans = x ** (1.0/3.0)
       print(‘The cube root of ‘ +format(x, ‘.3f’) + ‘ is ‘
              + format(ans, ‘.3f’) + ‘.’)

a format specifier

an argument

a literal string

all of the above

none of the above

My answer is a format specifier

2.The following statement includes a functioncall. Inside the parentheses of the function call, what do wecall(bill + tip) and 2?
total = round((bill + tip), 2)

global variables

arguments

literal values

a keyword

My answer is literal values

3.In the following function definition, what dowe call ans?
def show_cube_root(x):
       ans = x ** (1.0/3.0)
       print(‘The cube root of ‘ +format(x,

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.