Advertisement
stefano_p

Verifica_Liste

May 5th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. #D1=[[22,23,24],[33,33,33],[56,57,58]]
  2. #D2=[[22,23,24],[33,33,33],[56,57,58]]
  3. #CL1=[[1,2,3],[4,5,6],[33,34,35],[78,79,80]]
  4. #CL2=[33,34,35]
  5.  
  6.  
  7. def uguale(D1,D2):
  8. #@param D1,D2: list (of colors)
  9.   if len(D1) != len(D2):
  10.     return false
  11.   for i in range(0,len(D1)):
  12.     if D1[i] != D2[i]:
  13.       return false
  14.   return true
  15.  
  16.                           #ANCHE IN QUESTO ESERCIZIO mi sono perso nell'agitazione
  17.              
  18.                    
  19. def univ_uguale(CL1,CL2):
  20. #@ param CL1 : list (of colors)
  21. #@ param CL2 : list (of color)
  22.   for i in range(0,len(CL1) - len(CL2)+1):
  23.     if uguale(CL1[i:][i] , CL2):
  24.       return true
  25.   return false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement