3.1 Display number of dots from the given largest card to 1

Python solution

View solution

This is just one of many possible solutions:

number_of_dots = int(input('Enter the largest number of dots on the card: '))
while number_of_dots >= 1:
  print(number_of_dots)
  number_of_dots = round(number_of_dots / 2)

Back to programming challenge