एक प्रोग्राम डिज़ाइन करें जो 0 और 9,999 के बीच संख्याएँ लेता है और संख्या के बोले गए संस्करण को प्रिंट करता है।
संस्करण के अनुसार, हम अंकों के वर्गों को पहचान सकते हैं। 
हम यहां एक सामान्य पाठक-सहायता फ़ंक्शन बनाएँगे जो हमें संख्या के संस्करण लिखने में मदद करेगा। 

```
def num_in_words(num):
    ones = ['', 'one','two','three','four','five','six','seven','eight','nine']
    tens = ['', '', 'twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety']
    teens = ['ten', 'eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen']

    if num < 10:
        return ones[num]
    elif num < 20:
        return teens[num-10]
    elif num < 100:
        return tens[num//10] + ' ' + ones[num%10]
    elif num < 1000:
        return ones[num//100] + ' hundred ' + num_in_words(num%100)
    elif num < 1000000:
        return num_in_words(num//1000) + ' thousand ' + num_in_words(num%1000)
```

यहाँ हमने एक नंबर में हर एक अंक को पढ़ने के लिए अलग-अलग सूचकों का उपयोग किया है। अंकों के समूहों तक पहुँचने पर, हमें यह भी पता चलता है कि वे हैं: सौ, हजार या लाख। हमने सभी इन टेस्ट केस्स के लिए कोड लिखा है। 

```
for i in range(10_000):
    print(i, num_in_words(i))
```

प्रोग्राम फ़ाइल का पूरा कोड है: 

```
def num_in_words(num):
    ones = ['', 'one','two','three','four','five','six','seven','eight','nine']
    tens = ['', '', 'twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety']
    teens = ['ten', 'eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen']

    if num < 10:
        return ones[num]
    elif num < 20:
        return teens[num-10]
    elif num < 100:
        return tens[num//10] + ' ' + ones[num%10]
    elif num < 1000:
        return ones[num//100] + ' hundred ' + num_in_words(num%100)
    elif num < 1000000:
        return num_in_words(num//1000) + ' thousand ' + num_in_words(num%1000)


for i in range(10_000):
    print(i, num_in_words(i))
```

इस प्रोग्राम का आउटपुट नीचे दिया गया है: 

```
0 
1 one
2 two
3 three
4 four
5 five
6 six
7 seven
8 eight
9 nine
10 ten
11 eleven
12 twelve
13 thirteen
14 fourteen
15 fifteen
16 sixteen
17 seventeen
18 eighteen
19 nineteen
20 twenty
21 twenty one
22 twenty two
23 twenty three
24 twenty four
25 twenty five
26 twenty six
27 twenty seven
28 twenty eight
29 twenty nine
30 thirty
31 thirty one
32 thirty two
33 thirty three
34 thirty four
35 thirty five
36 thirty six
37 thirty seven
38 thirty eight
39 thirty nine
40 forty
41 forty one
42 forty two
43 forty three
44 forty four
45 forty five
46 forty six
47 forty seven
48 forty eight
49 forty nine
50 fifty
51 fifty one
52 fifty two
53 fifty three
54 fifty four
55 fifty five
56 fifty six
57 fifty seven
58 fifty eight
59 fifty nine
60 sixty
61 sixty one
62 sixty two
63 sixty three
64 sixty four
65 sixty five
66 sixty six
67 sixty seven
68 sixty eight
69 sixty nine
70 seventy
71 seventy one
72 seventy two
73 seventy three
74 seventy four
75 seventy five
76 seventy six
77 seventy seven
78 seventy eight
79 seventy nine
80 eighty
81 eighty one
82 eighty two
83 eighty three
84 eighty four
85 eighty five
86 eighty six
87 eighty seven
88 eighty eight
89 eighty nine
90 ninety
91 ninety one
92 ninety two
93 ninety three
94 ninety four
95 ninety five
96 ninety six
97 ninety seven
98 ninety eight
99 ninety nine
100 one hundred
101 one hundred one
102 one hundred two
103 one hundred three
104 one hundred four
105 one hundred five
106 one hundred six
107 one hundred seven
108 one hundred eight
109 one hundred nine
110 one hundred ten
111 one hundred eleven
112 one hundred twelve
113 one hundred thirteen
114 one hundred fourteen
115 one hundred fifteen
116 one hundred sixteen
117 one hundred seventeen
118 one hundred eighteen
119 one hundred nineteen
120 one hundred twenty
121 one hundred twenty one
122 one hundred twenty two
123 one hundred twenty three
124 one hundred twenty four
125 one hundred twenty five
126 one hundred twenty six
127 one hundred twenty seven
128 one hundred twenty eight
129 one hundred twenty nine
130 one hundred thirty
131 one hundred thirty one
132 one hundred thirty two
133 one hundred thirty three
134 one hundred thirty four
135 one hundred thirty five
136 one hundred thirty six
137 one hundred thirty seven
138 one hundred thirty eight
139 one hundred thirty nine
140 one hundred forty
141 one hundred forty one
142 one hundred forty two
143 one hundred forty three
144 one hundred forty four
145 one hundred forty five
146 one hundred forty six
147 one hundred forty seven
148 one hundred forty eight
149 one hundred forty nine
150 one hundred fifty
151 one hundred fifty one
152 one hundred fifty two
153 one hundred fifty three
154 one hundred fifty four
155 one hundred fifty five
156 one hundred fifty six
157 one hundred fifty seven
158 one hundred fifty eight
159 one hundred fifty nine
160 one hundred sixty
161 one hundred sixty one
162 one hundred sixty two
163 one hundred sixty three
164 one hundred sixty four
165 one hundred sixty five
166 one hundred sixty six
167 one hundred sixty seven
168 one hundred sixty eight
169 one hundred sixty nine
170 one hundred seventy
171 one hundred seventy one
172 one hundred seventy two
173 one hundred seventy three
174 one hundred seventy four
175 one hundred seventy five
176 one hundred seventy six
177 one hundred seventy seven
178 one hundred seventy eight
179 one hundred seventy nine
180 one hundred eighty
181 one hundred eighty one
182 one hundred eighty two
183 one hundred eighty three
184 one hundred eighty four
185 one hundred eighty five
186 one hundred eighty six
187 one hundred eighty seven
188 one hundred eighty eight
189 one hundred eighty nine
190 one hundred ninety
191 one hundred ninety one
192 one hundred ninety two
193 one hundred ninety three
194 one hundred ninety four
195 one hundred ninety five
196 one hundred ninety six
197 one hundred ninety seven
198 one hundred ninety eight
199 one hundred ninety nine
200 two hundred
201 two hundred one
202 two hundred two
203 two hundred three
204 two hundred four
205 two hundred five
206 two hundred six
207 two hundred seven
208 two hundred eight
209 two hundred nine
210 two hundred ten
211 two hundred eleven
212 two hundred twelve
213 two hundred thirteen
214 two hundred fourteen
215 two hundred fifteen
216 two hundred sixteen
217 two hundred seventeen
218 two hundred eighteen
219 two hundred nineteen
220 two hundred twenty
221 two hundred twenty one
222 two hundred twenty two
223 two hundred twenty three
224 two hundred twenty four
225 two hundred twenty five
226 two hundred twenty six
227 two hundred twenty seven
228 two hundred twenty eight
229 two hundred twenty nine
230 two hundred thirty
231 two hundred thirty one
232 two hundred thirty two
233 two hundred thirty three
234 two hundred thirty four
235 two hundred thirty five
236 two hundred thirty six
237 two hundred thirty seven
238 two hundred thirty eight
239 two hundred thirty nine
240 two hundred forty
241 two hundred forty one
242 two hundred forty two
243 two hundred forty three
244 two hundred forty four
245 two hundred forty five
246 two hundred forty six
247 two hundred forty seven
248 two hundred forty eight
249 two hundred forty nine
250 two hundred fifty
251 two hundred fifty one
252 two hundred fifty two
253 two hundred fifty three
254 two hundred fifty four
255 two hundred fifty five
256 two hundred fifty six
257 two hundred fifty seven
258 two hundred fifty eight
259 two hundred fifty nine
260 two hundred sixty
261 two hundred sixty one
262 two hundred sixty two
263 two hundred sixty three
264 two hundred sixty four
265 two hundred sixty five
266 two hundred sixty six
267 two hundred sixty seven
268 two hundred sixty eight
269 two hundred sixty nine
270 two hundred seventy
271 two hundred seventy one
272 two hundred seventy two
273 two hundred seventy three
274 two hundred seventy four
275 two hundred seventy five
276 two hundred seventy six
277 two hundred seventy seven
278 two hundred seventy eight
279 two hundred seventy nine
280 two hundred eighty
281 two hundred eighty one
282 two hundred eighty two
283 two hundred eighty three
284 two hundred eighty four
285 two hundred eighty five
286 two hundred eighty six
287 two hundred eighty seven
288 two hundred eighty eight
289 two hundred eighty nine
290 two hundred ninety
291 two hundred ninety one
292 two hundred ninety two
293 two hundred ninety three
294 two hundred ninety four
295 two hundred ninety five
296 two hundred ninety six
297 two hundred ninety seven
298 two hundred ninety eight
299 two hundred ninety nine
300 three hundred
301 three hundred one
302 three hundred two
303 three hundred three
304 three hundred four
305 three hundred five
306 three hundred six
307 three hundred seven
308 three hundred eight
309 three hundred nine
310 three hundred ten
311 three hundred eleven
312 three hundred twelve
313 three hundred thirteen
314 three hundred fourteen
315 three hundred fifteen
316 three hundred sixteen
317 three hundred seventeen
318 three hundred eighteen
319 three hundred nineteen
320 three hundred twenty
321 three hundred twenty one
322 three hundred twenty two
323 three hundred twenty three
324 three hundred twenty four
325 three hundred twenty five
326 three hundred twenty six
327 three hundred twenty seven
328 three hundred twenty eight
329 three hundred twenty nine
330 three hundred thirty
331 three hundred thirty one
332 three hundred thirty two
333 three hundred thirty three
334 three hundred thirty four
335 three hundred thirty five
336 three hundred thirty six
337 three hundred thirty seven
338 three hundred thirty eight
339 three hundred thirty nine
340 three hundred forty
341 three hundred forty one
342 three hundred forty two
343 three hundred forty three
344 three hundred forty four
345 three hundred forty five
346 three hundred forty six
347 three hundred forty seven
348 three hundred forty eight
349 three hundred forty nine
350 three hundred fifty
351 three hundred fifty one
352 three hundred fifty two
353 three hundred fifty three
354 three hundred fifty four
355 three hundred fifty five
356 three hundred fifty six
357 three hundred fifty seven
358 three hundred fifty eight
359 three hundred fifty nine
360 three hundred sixty
361 three hundred sixty one
362 three hundred sixty two
363 three hundred sixty three
364 three hundred sixty four
365 three hundred sixty five
366 three hundred sixty six
367 three hundred sixty seven
368 three hundred sixty eight
369 three hundred sixty nine
370 three hundred seventy
371 three hundred seventy one
372 three hundred seventy two
373 three hundred seventy three
374 three hundred seventy four
375 three hundred seventy five
376 three hundred seventy six
377 three hundred seventy seven
378 three hundred seventy eight
379 three hundred seventy nine
380 three hundred eighty
381 three hundred eighty one
382 three hundred eighty two
383 three hundred eighty three
384 three hundred eighty four
385 three hundred eighty five
386 three hundred eighty six
387 three hundred eighty seven
388 three hundred eighty eight
389 three hundred eighty nine
390 three hundred ninety
391 three hundred ninety one
392 three hundred ninety two
393 three hundred ninety three
394 three hundred ninety four
395 three hundred ninety five
396 three hundred ninety six
397 three hundred ninety seven
398 three hundred ninety eight
399 three hundred ninety nine
400 four hundred
401 four hundred one
402 four hundred two
403 four hundred three
404 four hundred four
405 four hundred five
406 four hundred six
407 four hundred seven
408 four hundred eight
409 four hundred nine
410 four hundred ten
411 four hundred eleven
412 four hundred twelve
413 four hundred thirteen
414 four hundred fourteen
415 four hundred fifteen
416 four hundred sixteen
417 four hundred seventeen
418 four hundred eighteen
419 four hundred nineteen
420 four hundred twenty
421 four hundred twenty one
422 four hundred twenty two
423 four hundred twenty three
424 four hundred twenty four
425 four hundred twenty five
426 four hundred twenty six
427 four hundred twenty seven
428 four hundred twenty eight
429 four hundred twenty nine
430 four hundred thirty
431 four hundred thirty one
432 four hundred thirty two
433 four hundred thirty three
434 four hundred thirty four
435 four hundred thirty five
436 four hundred thirty six
437 four hundred thirty seven
438 four hundred thirty eight
439 four hundred thirty nine
440 four hundred forty
441 four hundred forty one
442 four hundred forty two
443 four hundred forty three
444 four hundred forty four
445 four hundred forty five
446 four hundred forty six
447 four hundred forty seven
448 four hundred forty eight
449 four hundred forty nine
450 four hundred fifty
451 four hundred fifty one
452 four hundred fifty two
453 four hundred fifty three
454 four hundred fifty four
455 four hundred fifty five
456 four hundred fifty six
457 four hundred fifty seven
458 four hundred fifty eight
459 four hundred fifty nine
460 four hundred sixty
461 four hundred sixty one
462 four hundred sixty two
463 four hundred sixty three
464 four hundred sixty four
465 four hundred sixty five
466 four hundred sixty six
467 four hundred sixty seven
468 four hundred sixty eight
469 four hundred sixty nine
470 four hundred seventy
471 four hundred seventy one
472 four hundred seventy two
473 four hundred seventy three
474 four hundred seventy four
475 four hundred seventy five
476 four hundred seventy six
477 four hundred seventy seven
478 four hundred seventy eight
479 four hundred seventy nine
480 four hundred eighty
481 four hundred eighty one
482 four hundred eighty two
483 four hundred eighty three
484 four hundred eighty four
485 four hundred eighty five
486 four hundred eighty six
487 four hundred eighty seven
488 four hundred eighty eight
489 four hundred eighty nine
490 four hundred ninety
491 four hundred ninety one
492 four hundred ninety two
493 four hundred ninety three
494 four hundred ninety four
495 four hundred ninety five
496 four hundred ninety six
497 four hundred ninety seven
498 four hundred ninety eight
499 four hundred ninety nine
500 five hundred
501 five hundred one
502 five hundred two
503 five hundred three
504 five hundred four
505 five hundred five
506 five hundred six
507 five hundred seven
508 five hundred eight
509 five hundred nine
510 five hundred ten
511 five hundred eleven
512 five hundred twelve
513 five hundred thirteen
514 five hundred fourteen
515 five hundred fifteen
516 five hundred sixteen
517 five hundred seventeen
518 five hundred eighteen
519 five hundred nineteen
520 five hundred twenty
521 five hundred twenty one
522 five hundred twenty two
523 five hundred twenty three
524 five hundred twenty four
525 five hundred twenty five
526 five hundred twenty six
527 five hundred twenty seven
528 five hundred twenty eight
529 five hundred twenty nine
530 five hundred thirty
531 five hundred thirty one
532 five hundred thirty two
533 five hundred thirty three
534 five hundred thirty four
535 five hundred thirty five
536 five hundred thirty six
537 five hundred thirty seven
538 five hundred thirty eight
539 five hundred thirty nine
540 five hundred forty
541 five hundred forty one
542 five hundred forty two
543 five hundred forty three
544 five hundred forty four
545 five hundred forty five
546 five hundred forty six
547 five hundred forty seven
548 five hundred forty eight
549 five hundred forty nine
550 five hundred fifty
551 five hundred fifty one
552 five hundred fifty two
553 five hundred fifty three
554 five hundred fifty four
555 five hundred fifty five
556 five hundred fifty six
557 five hundred fifty seven
558 five hundred fifty eight
559 five hundred fifty nine
560 five hundred sixty
561 five hundred sixty one
562 five hundred sixty two
563 five hundred sixty three
564 five hundred sixty four
565 five hundred sixty five
566 five hundred sixty six
567 five hundred sixty seven
568 five hundred sixty eight
569 five hundred sixty nine
570 five hundred seventy
571 five hundred seventy one
572 five hundred seventy two
573 five hundred seventy three
574 five hundred seventy four
575 five hundred seventy five
576 five hundred seventy six
577 five hundred seventy seven