I'm running into a bit of trouble, I'm trying to create a list of places for the user to select from. The choices have distances assigned to them, I then want to get the first and second choices from the user and add the distances together, however it will only allow me to output as a string, whereas in this code I have chosen to output as an integer but I just get an error saying it can't do that. Here is the code I am trying to use, the code may look a little odd and that may be because we have to use a library that was created by one of our tutors.
- Code: Select all
print 'The available places to select from are: '
print 'Birmingham, Coventry, West Bromwich: '
Place1, Place2, Place3 = 50,40,30
First = raw_input('Please select from the list where you are coming from: ')
Second = raw_input('Please select where you are going to: ')
distance = First + Second
print('the distance between the two places are' +int(distance))