Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

check if list is in ascending order python

n = list(map(int, input().split())) #assign list values from input
if sorted(n) == n: #for descending, use sorted(n, reverse=True)
  print("Yes")
else:
  print("No")
  
#Hope this helps:)
Comment

PREVIOUS NEXT
Code Example
Python :: convert dictionary keys to list python 
Python :: method get first last name python 
Python :: python binary 
Python :: python check if key exist in json 
Python :: ipython history 
Python :: python encode file 
Python :: hist pandas 
Python :: what are test cases in python 
Python :: Concat Sort codechef solution 
Python :: remove french stopwords with spacy 
Python :: pandas read csv python 
Python :: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 7 supplied. 
Python :: inpuit inf terfminal ppython 
Python :: python in stack implementation 
Python :: Remove whitespace from str 
Python :: nltk 
Python :: python sum of array until index 
Python :: array creation in numpy 
Python :: how to sort the order in multiple index pandas 
Python :: moving element to last position in a list python 
Python :: while not command in python 
Python :: regex find all french phone number python 
Python :: python regex match 
Python :: create python dataframe 
Python :: python random choices weights 
Python :: django show image in admin page 
Python :: python dataframe appendisnt showing 
Python :: plot multiplr linear regression model python 
Python :: len python meaning 
Python :: how to submit two forms in django 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =