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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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:)