Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tup = (5, 4, 1)
- rez = 0
- for i in range(1, len(tup)):
- if tup[i - 1] == tup[i]:
- rez = 1
- break
- if tuple(sorted(tup)) == tup:
- if not rez:
- print('Зростаюча')
- else:
- print('Не спадна')
- elif tuple(sorted(tup)[::-1]) == tup:
- if not rez:
- print('Спадна')
- else:
- print('Не зростаюча')
- else:
- print('Не посл')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement