Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding=utf-8
- # Program zamieni ciąg cyfr na formę tekstową
- liczba = raw_input("Podaj jakąś liczbę: ")
- cyfra = ["zero", "jeden", "dwa", "trzy", "cztery", "pięć", "sześć", "siedem", "osiem", "dziewięć"]
- tekstowo = ''
- for wartosc in liczba:
- if not (ord(wartosc) > 57 or ord(wartosc) < 48):
- tekstowo += cyfra[ord(wartosc) - 48]+' '
- print tekstowo
Advertisement
Add Comment
Please, Sign In to add comment