What is the output of the following code: total = 0for count…