@anonymous/

SquareLinearConferences

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import json


def handle_input(input_):
    try:
        data = json.loads(input_)
    except ValueError:
        raise ValueError('Invalid format.')

    if len(data) != 4:
        raise ValueError('Incorrect amount of numbers')
    return data


def main():
    print('Enter four numbers in brackets. E.g. [1, 2, 3, 4]')
    data = handle_input(input())
    print(
        '{0} {1} {2} {3}\n'
        '{3} {2} {1} {0}\n'
        '{1} {0} {3} {2}\n'
        '{2} {3} {0} {1}\n'
        .format(*data)
    )


if __name__ == '__main__':
    main()