Note that there are some explanatory texts on larger screens.

plurals
  1. POpython simple money code beginner
    primarykey
    data
    text
    <p>I'm doing suppose to convert a money value into a string value. Example: 10675.78 would turn to "ten thousand six hundred seventy five and 78/100 dollars</p> <p>I think I'm making this much more complicated than it needs to be. any suggestions?</p> <pre><code>def money(value): x = str(value) if len(x)&gt;8: return ("Error. Value exceeds limit.") elif len(x)==0: return ("Error. Must enter a value.") for len(x) in range(0,7): for x[6:8]: a = x[6:8] print(a,'/100 dollars') for x[3:5]: b = x[4:6] if b = '10' tens = 'ten' elif b = '11' tens = 'eleven' elif b = '12' tens = 'twelve' elif b = '13' tens = 'thirteen' elif b = '14' tens = 'fourteen' elif b = '15' tens = 'fifteen' elif b = '16' tens = 'sixteen' elif b = '17' tens = 'seventeen' elif b = '18' tens = 'eighteen' elif b = '19' tens = 'nineteen' else: return false for x[4]: c = x[4] if b = true: fifth = '' elif c = '9' fifth = 'nine' elif c = '8' fifth = 'eight' elif c = '7' fifth = 'seven' elif c = '6' fifth = 'six' elif c = '5' fifth = 'five' elif c = '4' fifth = 'four' elif c = '3' fifth = 'three' elif c = '2' fifth = 'two' elif c = '1' fifth = 'one' elif c = '0' fifth = '' for x[3]: d = x[3] if b = true: fourth = '' elif d = '9' fourth = "ninety " elif d = '8' fourth = "eighty " elif d = '7' fourth = "seventy " elif d = '6' fourth = "sixty " elif d = '5' fourth = "fifty " elif d = '4' fourth = "forty " elif d = '3' fourth = "thirty " elif d = '2' fourth = "twenty " elif d = '0' fourth = '' for x[2]: e = x[2] if e = '9' third = 'nine hundred ' elif e = '8' third = 'eight hundred ' elif e = '7' third = 'seven hundred ' elif e = '6' third = 'six hundred ' elif e = '5' third = 'five hundred ' elif e = '4' third = 'four hundred ' elif e = '3' third = 'three hundred ' elif e = '2' third = 'two hundred ' elif e = '1' third = 'one hundred ' for x[0:2]: j = [0:2] if j = '10' second = 'ten thousand ' elif j = '11' second = 'eleven thousand ' elif j = '12' second = 'twelve thousand ' elif j = '13' second = 'thirteen thousand ' elif j = '14' second = 'fourteen thousand ' elif j = '15' second = 'fifteen thousand ' elif j = '16' second = 'sixteen thousand ' elif j = '17' second = 'seventeen thousand ' elif j = '18' second = 'eighteen thousand ' elif j = '19' second = 'nineteen thousand' else: return false for x[1]: g = x[1] if j = true: second = '' elif g = '9' second = 'nine thousand ' elif g = '8' second = 'eight thousand ' elif g = '7' second = 'seven thousand ' elif g = '6' second = 'six thousand ' elif g = '5' second = 'five thousand ' elif g = '4' second = 'four thousand ' elif g = '3' second = 'three thousand ' elif g = '2' second = 'two thousand ' elif g = '1' second = 'one thousand' elif g = '0' second = '' for x[0]: h = x[0] if j = true: first = '' elif h = '9' first = 'ninety ' elif h = '8' first = 'eighty ' elif h = '7' first = 'seventy ' elif h = '6' first = 'sixty ' elif h = '5' first = 'fifty ' elif h = '4' first = 'fourty ' elif h = '3' first = 'thirty ' elif h = '2' first = 'twenty ' </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload