Advertisement
akchonya

Untitled

Jun 20th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. tup = (5, 4, 1)
  2.  
  3. rez = 0
  4. for i in range(1, len(tup)):
  5.     if tup[i - 1] == tup[i]:
  6.         rez = 1
  7.         break
  8.  
  9. if tuple(sorted(tup)) == tup:
  10.     if not rez:
  11.         print('Зростаюча')
  12.     else:
  13.         print('Не спадна')
  14. elif tuple(sorted(tup)[::-1]) == tup:
  15.     if not rez:
  16.         print('Спадна')
  17.     else:
  18.         print('Не зростаюча')
  19. else:
  20.     print('Не посл')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement