In Python I have a function that prints something. I want to print something beforehand on the same line.
So, I use the following code
print 'The hand is', displayHand(hand)
def displayHand(hand):
for letter in hand.keys():
for j in range(hand[letter]):
print letter, # print all on the same line
print # print an empty line
What happens however is that the print within the function is called by the print outside the function.
How can I print an opening string, and then call my function?