External Exam Download Resources Web Applications Games Recycle Bin

Exercise 3 - Five Stars

An algorithm is required to print the asterisk ('*') symbol 5 times in html code (i.e., using '*').

The end result should look like this:

For some reason, this algorithm is stuck in an 'infinite loop'. Please fix it:

BEGIN fiveStars
  asterisk = "*"
  number = 1

  WHILE number <= 5
    PRINT asterisk  

  ENDWHILE

END

Code the algorithm here in Python once you have fixed it:

def fiveStars():
  asterisk = "&ast;"
  number = 1
  while #keep typing here...

fiveStars()