about summary refs log tree commit diff stats
path: root/calc_position.py
diff options
context:
space:
mode:
Diffstat (limited to 'calc_position.py')
-rw-r--r--calc_position.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/calc_position.py b/calc_position.py
index dacfb90..1108ff1 100644
--- a/calc_position.py
+++ b/calc_position.py
@@ -3,7 +3,11 @@ import re
 with open("pi_million", "r") as f:
     text = f.read()
 
-number = int(input("Search for: "))
+try:
+    number = int(input("Search for: "))
+except ValueError:
+    print("Input has to be a number")
+    exit()
 
 match = re.search(rf"{number}", text)