7th_is_sorted_function_check_list

 def is_sorted(stuff):

    for i in range (len(stuff)-1):
        if stuff[i]>stuff[i+1]:
            return False
    else:
        return True
numbers=[1,2,3,4,0]
print(is_sorted(numbers))

Comments

Popular posts from this blog

JAVA Lab Programs

HANGMAN GAME

WD 22. StylingLinks&Buttons