Advertisement
david929

Untitled

Apr 6th, 2022
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. def strict(f):
  2.    
  3.     f = sorted(f, key=lambda x:x[0])
  4.  
  5.     x = f[0]
  6.    
  7.     for el in f:
  8.         if el[0] == x[0] and el[1] != x[1]: # se x=x e y!=y
  9.             return False                                     # FALSE
  10.         if el[0] != x[0] and el[1] == x[1]: # se x!=x e y=y
  11.             return False
  12.         x = el
  13.    
  14.     y=f[0][0]
  15.     for el in f:
  16.         if el[1] < y:
  17.             return False
  18.         y = el[1]
  19.     return True
  20.    
  21.    
  22. strict(f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement