From 4bb0f248cd239a1f8d9ef6086ec4d1857381d96e Mon Sep 17 00:00:00 2001 From: Mitchell Resnick Date: Mon, 29 Aug 2022 17:19:52 -0400 Subject: [PATCH] Cast user input to int The user's input is used as a list index, which must be an `int` and not a `string`. This value must be cast to be used. --- lib/workbench.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/workbench.py b/lib/workbench.py index 850c017..3c8ce37 100644 --- a/lib/workbench.py +++ b/lib/workbench.py @@ -22,7 +22,7 @@ def get_domain(company): #Clearbit API - clearbit.com print "Multiple domains identified for company. Which one is the target?" for index, result in enumerate(clearbit_results): print "{}) Name: {}, Domain: {}".format(index, result["name"], result["domain"]) - choice = input() + choice = int(input()) domain = clearbit_results[choice]["domain"] if domain: @@ -113,4 +113,4 @@ def format_email(eformat, first, last): } return formats[eformat] except Exception as e: - print e \ No newline at end of file + print e