Def confuse n total 0 for I in range abs n total n return

Def confuse (n): total = 0 for I in range (abs (n)): total - = n return total What value is returned by confuse (-4)? - c) Fill in the symbols in the flowchart to the right so that the logic is identical to that of the python code above.

Solution

a)
confuse(-4)

=> total = 4+4+4+4 = 16
16 will be returned.

b)i < n // condition
c)i = i+1 // increment of loop control variable

 Def confuse (n): total = 0 for I in range (abs (n)): total - = n return total What value is returned by confuse (-4)? - c) Fill in the symbols in the flowchart

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site