Program to fid if a list is sorted or not

list1 = [1, 2, 3, 4, 5, 7, 8, 9]


temp_list=list1[:]

list1.sort()

if temp_list==list1:

    print ("True")


else:

    print ("False")

Comments

Popular posts from this blog

Guess game!

Path for chromedriver