aboutsummaryrefslogtreecommitdiff
path: root/challenge-332/packy-anderson/python/ch-1.py
blob: 262e52844dc19a1f16dc1c376696b6f0af38929b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python

def binary_date(date):
  return '-'.join([ bin(int(i))[2:] for i in date.split('-')])

def solution(date):
  print(f'Input: $date = "{date}"')
  print(f'Output: "{binary_date(date)}"')

print('Example 1:')
solution("2025-07-26")

print('\nExample 2:')
solution("2000-02-02")

print('\nExample 3:')
solution("2024-12-31")