From 968ce11438a3bcb52ddaa0ac7e0ab503f17291ce Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Jul 2024 22:08:05 +0200 Subject: [PATCH] python --- get_num_square.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 get_num_square.py diff --git a/get_num_square.py b/get_num_square.py new file mode 100644 index 0000000..b4d4cda --- /dev/null +++ b/get_num_square.py @@ -0,0 +1,11 @@ +import os + +num = os.environ.get("INPUT_NUM") +if num: + try: + num = int(num) + except Exception: + exit("ERROR: the INPUT_NUM provided ({num}) is not an integer") + print(num**2) +else: + num = 1