Dec-04-2018, 05:52 PM
list=['the','i','am','light','life'] a=sorting(list) def sorting(x): for i in range(0,4): if len(x[i]) < len(x[i+1]): pass else: temp=x[i+1] x[i+1]=x[i] x[i]=temp print(a)This coding prints None.
I believe i need to put in "return" somewhere inside the "def sorting(x)"
Can anyone help?