Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. def check_sequence(sequence):
  2.     resList = []
  3.     for i in range(0, len(sequence) - 1):
  4.         if sequence[i] < sequence[i+1]:
  5.             resList.append(True)
  6.         else:
  7.             resList.append(False)
  8.     if len(set(resList)) == 1 and list(set(resList))[0] == True:
  9.         return 1
  10.     elif len(set(resList)) == 1 and list(set(resList))[0] == False:
  11.         return -1
  12.     else:
  13.         return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement