I need to print the elements of list, such that if an element is 100 or greater, it's followed by a newline, and if not, it's followed by a space.
This is what I have so far:
def function(list):
if list == []:
return None
elif list[0] >= 100:
print(list[0], function(list[1:]), end = '\n')
else:
print(list[0], function(list[1:]), end = '')
return None
But when I try list = [2,3,103, 8, 10], Python prints:
10 None8 None103 None
3 None2 None
Any suggestions/help?