Advertisement
Guest User

is_sorted_list

a guest
May 1st, 2022
41
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n=int(input())
  2.  
  3. for i in range(n):
  4.     arr = list(map(int, input().split(",")))
  5.     isSorted ='true'
  6.     for j in range(len(arr)-1):
  7.         if (arr[j] > arr[j + 1]):
  8.             isSorted = 'false'
  9.             break
  10.        
  11.    
  12.     print(isSorted)
Advertisement
RAW Paste Data Copied
Advertisement