I\'m trying to assign a print statement to a variable in a function:
def namer(fn, ln=\'Smith\'):
# return value, default value
r = print \"Your name is
The print statement only prints the value to your monitor. It doesn't make any sense to assign it to a variable.
If your code is meant to store the string in the variable r, then:
r = "Your name is " + fn + " "+ ln
This would work provided fn is a string, if not:
r= "Your name is " + str(fn) +" "+ ln