Solving a shipping programming problem for school, just started with python 2.7.5, trying to make US or Canada a choice, as it stands I had to make a numerical choice to get this to work, I'm trying to get the choice for the prompt as US or Canada and not assign a number, do I have to declare something as a string? If I use Canada or US it gives me an error message about a global variable. rough draft with number choice:
def main ():
user_ship_area = input('Are you shipping to the US or Canada? Type 1 for US, 2 for Canada')
if user_ship_area != 2:
print 'confirmed, we will ship to the United States '
else:
print "confirmed, we will ship to Canada"
main()
I get an Error message when I use Canada or US under if
user_ship_area = input('Are you shipping to the US or Canada?')
if user_ship_area != Canada:
print 'confirmed, we will ship to the United States '
else:
print "confirmed, we will ship to Canada"