Guest User

incdecseq

a guest
Apr 5th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. n=int(input())
  2. l=list()
  3. for i in range(n):
  4.     l.append(int(input()))
  5.  
  6. def checkseq(n,l=[]):
  7.     for i in range(n-1):
  8.         if(l[i]>l[i+1]):
  9.             pass
  10.         else:
  11.             break
  12.    
  13.     if l[i]==l[i+1]:
  14.         i +=1
  15.    
  16.     for j in range(i,n-1):
  17.         if(l[j]<l[j+1]):
  18.             pass
  19.         else:
  20.             return False
  21.            
  22.     return True
  23.  
  24. print(checkseq(n,l))
Add Comment
Please, Sign In to add comment