PROBLEM #1 Consider the following python code. def kkk(x, y = 10): result = 1 while x


PROBLEM #1


Consider the following python code.



def kkk(x, y = 10):

    result = 1

    while x <>

        y -= 2

        x += 1

        result += x

    return result





What value should we pass for the argument (arg) in the following statement so that it prints 14?




print( kkk(arg) )



PROBLEM #2




If the following Python code is executed, what will be the type and value of the last expression being evaluated?



x = 12



def hhh(y):

    return x + y



def ggg(x):

    x = x + 1

    return hhh(6)



print( ggg(x) )



Entertype,value
as your answer (separated by a comma with no additional space). If evaluating an expression would cause an error, enter NoneType as the type and 'error' as the value.







Consider the following python code.<br>def kkk(x,<br>10):<br>result<br>1<br>while x <= y _and y != 4:<br>x += 1<br>result = x<br>return result<br>What value should we pass for the argument (arg) in the following statement so that<br>it prints 14?<br>print ( kkk (arg) )<br>

Extracted text: Consider the following python code. def kkk(x, 10): result 1 while x <= y="" _and="" y="" !="4:" x="" +="1" result="x" return="" result="" what="" value="" should="" we="" pass="" for="" the="" argument="" (arg)="" in="" the="" following="" statement="" so="" that="" it="" prints="" 14?="" print="" (="" kkk="" (arg)="">
If the following Python code is executed, what will be the type and value of the last<br>expression being evaluated?<br>12<br>def hhh(y):<br>return x + y<br>def ggg(x):<br>X = X + 1<br>return hhh(6)<br>print ( ggg (x) )<br>Enter type,value as your answer (separated by a comma with no additional space). If<br>evaluating an expression would cause an error, enter NoneType as the type and<br>'error' as the value.<br>

Extracted text: If the following Python code is executed, what will be the type and value of the last expression being evaluated? 12 def hhh(y): return x + y def ggg(x): X = X + 1 return hhh(6) print ( ggg (x) ) Enter type,value as your answer (separated by a comma with no additional space). If evaluating an expression would cause an error, enter NoneType as the type and 'error' as the value.

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here