SHARE
TWEET

Untitled

a guest Feb 12th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. twinGap = 0 // current gap between twins
  2. count = 0  
  3. maxTwinGap = 0 // max gap between twins
  4.  
  5. // while loop goes through all entries of list twins
  6. while count < len(twins):
  7.    
  8.     // gap between twins is the list entry of index count + 1 (a tuple)
  9.     // the [1] selects the second entry in the tuple
  10.     twinGap = twins[count+1][1] - nextP
  11.    
  12.     // if the current twinGap is > maxTwinGap, we have a new maxTwinGap
  13.     if twinGap > maxTwinGap:
  14.         maxTwinGap = twinGap
  15.    
  16.     // loop update condition
  17.     count +=1
  18.  
  19. print twinGap
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top