1.4 Display Binary Numbers (using a variable, operator and a repeat loop)

Python solution

View solution

This is just one of many possible solutions:

number_of_dots = 1
for i in range(0, 5):
  print(number_of_dots)
  number_of_dots = number_of_dots * 2

Back to programming challenge

Extra Challenge

Display the numbers from largest to smallest (display numbers 16, 8, 4, 2 and 1).