Project Euler 17 - Number letter counts

Official link: https://projecteuler.net/problem=17

Thought Process

I created 2 list:

  1. ONES = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]

  2. TENS = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]

I then have a function Number_to_english(x) that takes a number and return the word version of the number

Interactive Code

Input an integer (yourinput)

Code will output the amount of letters used for all numbers up till yourinput