Skip to content

Instantly share code, notes, and snippets.

@zimolzak
Created August 11, 2020 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zimolzak/bddfc0771d5b60e24d7fb5d9980bf115 to your computer and use it in GitHub Desktop.
Save zimolzak/bddfc0771d5b60e24d7fb5d9980bf115 to your computer and use it in GitHub Desktop.
Make string with specified number of dots, in rows of 10. Useful to show a toddler which is the bigger number.
def arrange_dots(number):
"""Make string with specified number of dots, in rows of 10.
Useful to show a toddler which is the bigger number.
"""
tens = number // 10
ones = number % 10
row_of_ten = '.' * 10 + '\n'
rectangle = '\n' + row_of_ten * tens
return(rectangle + '.' * ones)
if __name__ == '__main__':
print(arrange_dots(72))
print(arrange_dots(56))
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment