Apr-15-2017, 10:34 PM
Up to 99, you can do it with two lists:
under_twenty = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', ..., 'nineteen'] twenty_up = ['twenty', 'thirty', 'forty', ..., 'ninety']Then you can use numeric indexing (divided by ten for twenty_up, hint: use //), and only have three cases to worry about: 0, < 20, >= 20.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures