Python program to know if a list is sorted . Output and code image attached.
def isSorted(lst2):
for p in range(len(lst2)):
for z in range(p,len(lst2)):
#Return false if an item is less than or equal to its successor
if lst2[p]>lst2[z]:
return False
return True
if __name__ == '__main__':
list = [int() for ind0 in range(5)]
ans = str
print("Enter 5 numbers: ")
for d in range(5):
list[d] = int(input())
ans = isSorted(list)
if (ans):
print("Yes")
else:
print("No")
To learn more about sort lists in python see: https://brainly.com/question/20624654
#SPJ4