print
just prints stuff. It's not what you want if you need to do any extra processing on the result.
return
returns a value from a function so you can add it to a list, store it in a database etc. Nothing is printed
What may confuse you is that the Python interpreter will print the returned value, so it might look like they do the same thing if that is all you are doing.
eg suppose you need to calculate the total wins:
def count_wins(teamname):
wins = 0
for team in nfl:
if team[2] == teamname:
wins +=1
return wins
total_wins = 0
for teamname in teamnames:
# doing stuff with result
total_wins += count_wins(teamname)
# now just print the total
print total_wins
def count_wins(teamname):
wins = 0
for team in nfl:
if team[2] == teamname:
wins +=1
print wins
for teamname in teamnames:
# count_wins just returns None, so can't calculate total
count_wins(teamname)