GEOG 485:
GIS Programming and Software Development

Lesson 1 Practice Exercise 2 Solution



first = "Joe"
last = "Paterno"
full = first + " " + last

print (full)


In this script, two string variables are used to hold the two name pieces. The two pieces are merged together using the concatenation character (+ in Python). A space is inserted between them using a space within quotes. 

If you wanted to display the name pieces last name first and with a comma in between, you would change the 'full' statement as follows:

full = last + ", " + first