print ("%s" % (string_variable))
where:
print "My last name is %s and my first-name is %s" % ("Gerard", "Nico")
In python 3, print becomes a function
print ("My last name is %s and my first-name is %s" % ("Gerard", "Nico"))
By appending a , at the end of the statement, you prevent the print function to add a newline
print "Lines without",
print "New Line",
Lines without New Line
dictionary = {'key1': 1, 'key2': 2, 'key3': 3}
for key in dictionary:
print key, ":" , dictionary[key]
key3 : 3
key2 : 2
key1 : 1