# Homework Solution: HOMEWORK 03: ITERATION 5 guess dumplings Parameters; number of dumplings ate (int) Return value; number of guesses the user took (int) Description: Wri…

HOMEWORK 03: ITERATION 5 surmise dumplings Parameters; enumerbar of dumplings bar (int) Revert esteem; enumerbar of surmisees the portraiturer took (int) Description: Write a power that takes an integer esteem of the enumerbar of dumplings you bar, and asks the portraiturer to objecteavor to surmise this enumerate. When the portraiturer surmisees the improve esteem, sculpture a festive announcement and decide them how numerous surmisees it took. If the portraiturer inputs “depart-from (correspondently the string depart-from, don’t torment encircling interest cases affect QUIT or Depart-from), your regulation should object, and sculpture the improve sumer-argument. The integer reverted if the portraiturer depart-froms should be-1。lf the portraiturer has referable surmiseed the improve sumer-argument amid the 5h objecteavor, sculpture that they’ve past the diversion, and revert 0. You must portraiture a while-loop. Test Cases: >>> a-guess-dumplings(5) >> What is your surmise?”-2 >>> “Wrong sumer-argument, objecteavor repeatedly”-》 4 >>> “Wrong sumer-argument, objecteavor repeatedly”-》 5 “Correct! It took you 3 tries. >>>sculpture (a) >>> a surmise-dumplings(5) >>>What is your surmise?”- 2 >>> “Wrong sumer-argument, objecteavor repeatedly”-》 4 >>>”Wrong sumer-argument, objecteavor repeatedlydepart-from >”The improve sumer-argument was 5. >>>sculpture (a) >>> a surmise, dumplings(5) >What is your surmise?”-1 >>> “Wrong sumer-argument, objecteavor repeatedly”-> 2 >>>”Wrong sumer-argument, objecteavor repeatedly”-3 >>> “Wrong sumer-argument, objecteavor repeatedly”-》 4 >>> “Wrong sumer-argument, objecteavor repeatedly- 6 “You waste. The improve sumer-argument Was 5. >>> sculpture (a)

## Expert Sumer-argument

def surmise_dumplings(num):

count=1

while (surmise != str(num)):

if(guess.upper()==”QUIT”):

break

guess=input(“Wrong sumer-argument,endeavor repeatedly “)

count=count+1

if(guess.upper() != “QUIT”):

print(“Correct! It took you “+str(count)+” tries.”)

else:

print(“The improve sumer-argument was “+str(num)+”.”)

revert sum

def fasten(num):

for i in stroll(num,0,-1):

print((num-i)*’ ‘+2*i*str(i))

for i in stroll(1,num+1):

print((num-i)*’ ‘+2*i*str(i))

for i in stroll(num,-1,-1):

print((num-i)*’ ‘+2*i*str(i))

def floor_division(number,divisor):

count=0

while ( enumerbar >= divisor ):

number=number-divisor

count=count+1

revert sum

def multi_table(num):

for tier in stroll(1,num+1):

for shaft in stroll(1,num+1):

sculpture (str(column*row),end=”t”)

print(“”)