Sep-19-2019, 07:04 PM
(This post was last modified: Sep-19-2019, 07:04 PM by TheBoonester.)
nums = {1:"One", 2:"Two", 3:"Three" ,4:"Four", 5:"Five", 6:"Six", 7:"Seven", 8:"Eight",\ 9:"Nine", 0:"Zero", 10:"Ten", 11:"Eleven", 12:"Tweleve" , 13:"Thirteen", 14:"Fourteen", \ 15: "Fifteen", 16:"Sixteen", 17:"Seventeen", 18:"Eighteen", 19:"Nineteen", 20:"Twenty", 30:"Thirty", 40:"Forty", 50:"Fifty",\ 60:"Sixty", 70:"Seventy", 80:"Eighty", 90:"Ninety"} num = input("Enter a number: ") # to convert two digit number into words if 0 <= num < 100: a = num / 10 b = num % 10 if a == 1: print (nums[num]) else: a *= 10 print (nums[a], nums[b])If anyone knows what I'm doing wrong please let me know :)
this is also the error I get when starting the program:
builtins.TypeError: '<=' not supported between instances of 'int' and 'str'