If you are using python2 ,input is returning integer,
so you need do to:
response = input("Hello! Welcome to the DNS Cable Company's Service Portal. Are you a new or existing customer? \n [1] New Customer \n [2] Existing Customer \n Please enter the number corresponding to your choice:")
if response == 1:
return new_customer()
or:
response = input("Hello! Welcome to the DNS Cable Company's Service Portal. Are you a new or existing customer? \n [1] New Customer \n [2] Existing Customer \n Please enter the number corresponding to your choice:")
if str(response) == "1":
return new_customer()
Examples:
Python 2.x
s1 = raw_input("Enter raw_input to test raw_input() function: ")
>> 3
print (type(s1)) <type 'str'>
s11 = raw_input("Enter raw_input to test raw_input() function: ")
>> a
print (type(s11)) <type 'str'>
s2 = input("Enter input to test input() function: ")
>> 3
print (type(s2)) <type 'int'>
s22 = input("Enter input to test input() function: ")
>> a
print (type(s22)) <type 'str'>
Python 3.x
s3 = input("Enter input to test input() function: ")
>> 1
print (type(s3)) <type 'str'>
s33 = input("Enter input to test input() function: ")
>> a
print (type(s33)) <type 'str'>
EDIT:
def new_customer():
print ("new_customer")
def existing_customer():
print ("existing_customer")
def cs_service_bot():
# Replace `pass` with your code
response = input("Hello! Welcome to the DNS Cable Company's Service Portal. Are you a new or existing customer? \n [1] New Customer \n [2] Existing Customer \n Please enter the number corresponding to your choice:")
if response == "1":
return new_customer()
elif response == "2":
return existing_customer()
else:
print("Sorry, we didn't understand your selection.")
return cs_service_bot()
cs_service_bot()
output:
Hello! Welcome to the DNS Cable Company's Service Portal. Are you a new or existing customer?
[1] New Customer
[2] Existing Customer
Please enter the number corresponding to your choice:1
new_customer