SHARE
TWEET

Day 6 Part 1

a guest Dec 6th, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. code = ["COM)B","B)C","C)D","D)E","E)F","B)G","G)H","D)I","E)J","J)K","K)L"]
  2.  
  3. dorbits = iorbits = 0
  4. for item1 in code:
  5.     planlist_ = item1.split(")")
  6.     plan1_ = planlist_[0]
  7.     plan2_ = planlist_[1]
  8.     dorbits += 1
  9.     for item2 in code:
  10.         if not item2 == item1:
  11.             planlist = item2.split(")")
  12.             plan1 = planlist[0]
  13.             plan2 = planlist[1]
  14.             if plan1_ == plan2:
  15.                 iorbits += 1
  16.  
  17.  
  18. print(dorbits + iorbits)
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