2.1 Display number of dots for a given number of cards

Python solution

View solution

This is just one of many possible solutions:

number_of_cards = int(input('How many cards would you like to display? '))
number_of_dots = 1
for i in range(0, number_of_cards):
  print(number_of_dots)
  number_of_dots = number_of_dots * 2

Back to programming challenge