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' 

read join() here in docs , quick tutorial on how use here


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -