Advertisement
Guest User

orkaa

a guest
Oct 23rd, 2008
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.17 KB | None | 0 0
  1. meseci = ['januar','februar','marec','april','maj','junij','julij','avgust','september','oktober','november','december']
  2.  
  3. def pridobi_dan():
  4. >---while True:
  5. >--->---dan = raw_input('Vpisi dan: ')
  6. >--->---if dan.isdigit():
  7. >--->--->---dan = int(dan)
  8. >--->--->---if (dan >= 1 and dan <= 31):
  9. >--->--->--->---return dan
  10.  
  11. def pridobi_mesec():
  12. >---while True:
  13. >--->---mesec = raw_input('Vpisi mesec: ')
  14. >--->---if mesec.isdigit():
  15. >--->--->---mesec = int(mesec)
  16. >--->--->---if (mesec >= 1 and mesec <= 12):
  17. >--->--->--->---return mesec
  18.  
  19. def pridobi_leto():
  20. >---while True:
  21. >--->---leto = raw_input('Vpisi leto: ')
  22. >--->---if leto.isdigit():
  23. >--->--->---leto = int(leto)
  24. >--->--->---return leto
  25.  
  26. def izpisi_datum(dan, mesec, leto):
  27. >---while True:
  28. >--->---vprasanje = raw_input('kratek ali dolg izpis? ')
  29. >--->---if vprasanje == 'kratek':
  30. >--->--->---print '%s. %s. %s' % (dan, mesec, leto)
  31. >--->--->---break
  32. >--->---elif vprasanje == 'dolg':
  33. >--->--->---print '%s. %s %s' % (dan, meseci[mesec-1], leto)
  34. >--->--->---break
  35.  
  36. if __name__ == '__main__':
  37. >---dan = pridobi_dan()
  38. >---mesec = pridobi_mesec()
  39. >---leto = pridobi_leto()
  40. >---izpisi_datum(dan, mesec, leto)
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement