check if list is in ascending order python

Solutions on MaxInterview for check if list is in ascending order python by the best coders in the world

showing results for - "check if list is in ascending order python"
Adem
24 Nov 2016
1n = list(map(int, input().split())) #assign list values from input
2if sorted(n) == n: #for descending, use sorted(n, reverse=True)
3  print("Yes")
4else:
5  print("No")
6  
7#Hope this helps:)