Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- meseci = ['januar','februar','marec','april','maj','junij','julij','avgust','september','oktober','november','december']
- def pridobi_dan():
- >---while True:
- >--->---dan = raw_input('Vpisi dan: ')
- >--->---if dan.isdigit():
- >--->--->---dan = int(dan)
- >--->--->---if (dan >= 1 and dan <= 31):
- >--->--->--->---return dan
- def pridobi_mesec():
- >---while True:
- >--->---mesec = raw_input('Vpisi mesec: ')
- >--->---if mesec.isdigit():
- >--->--->---mesec = int(mesec)
- >--->--->---if (mesec >= 1 and mesec <= 12):
- >--->--->--->---return mesec
- def pridobi_leto():
- >---while True:
- >--->---leto = raw_input('Vpisi leto: ')
- >--->---if leto.isdigit():
- >--->--->---leto = int(leto)
- >--->--->---return leto
- def izpisi_datum(dan, mesec, leto):
- >---while True:
- >--->---vprasanje = raw_input('kratek ali dolg izpis? ')
- >--->---if vprasanje == 'kratek':
- >--->--->---print '%s. %s. %s' % (dan, mesec, leto)
- >--->--->---break
- >--->---elif vprasanje == 'dolg':
- >--->--->---print '%s. %s %s' % (dan, meseci[mesec-1], leto)
- >--->--->---break
- if __name__ == '__main__':
- >---dan = pridobi_dan()
- >---mesec = pridobi_mesec()
- >---leto = pridobi_leto()
- >---izpisi_datum(dan, mesec, leto)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement