Small projectIntermediate30 XPExercise 5/16

Birth number

Task

A Slovak birth number has the form RRMMDDXXXX (10 digits, entered without the slash):

  • RR are the last two digits of the birth year - 54 and more means 19RR, otherwise 20RR,
  • MM is the month of birth, increased by 50 for women (May is 55 for a woman),
  • DD is the day of birth,
  • the whole 10-digit number is divisible by 11.

The program reads a birth number. If it is valid (exactly 10 digits, divisible by 11, month 1 to 12 and day 1 to 31), it prints three lines: platne (valid), the sex (muz - man or zena - woman) and the date of birth as DD.MM.RRRR. Otherwise it prints only neplatne (invalid).

What the program should do

For 0503151231 the program prints platne, muz and 15.03.2005.

Examples

  • Input

    0503151231

    Expected output

    platne
    muz
    15.03.2005
  • Input

    9857023297

    Expected output

    platne
    zena
    02.07.1998

After you submit, 8 hidden tests will also check your solution: a woman, year 2004, the year 1954, not divisible by 11, month 13, day 32, a woman with month 63, 9 digits, a letter inside.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.