logo

Crowdly

A student changes the loop to:   while current <= 7:       if curr...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

A student changes the loop to: 

while current <= 7: 

    if current % 2 == 0: 

        continue 

    total = total + current 

    current = current + 1 

The initial values are still current = 1 and total = 0. 

Explain why this version never reaches the print statement. State the values of current and total once the program becomes stuck. [2 marks] 

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle1.maths.ed.ac.uk?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!