how to Print a function without printing the Return type in Python? -
i want print this:
current hand: e i n r t
a e i n r t
, output of following function no return type:
def abcd(hand): letter in hand: print letter print
i use print "current hand:",abcd(hand)
following op:
current hand: e i n r t none
can ?
if want output letters should return them string.
def abcd(hand): return ' '.join(hand) >>> print("current hand:",abcd('aeiinrt')) current hand: e i n r t >>> abcd('aeiinrt') 'a e i n r t'
Comments
Post a Comment