Advertisement
Spocoman

06. Electron Distribution

Feb 11th, 2022
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. import sys
  2.  
  3. electrons = int(input())
  4. shells = []
  5.  
  6. for i in range(1, sys.maxsize):
  7.     shell = 2 * i ** 2
  8.     electrons -= shell
  9.     if electrons < 0:
  10.         shells.append(shell + electrons)
  11.         break
  12.     shells.append(shell)
  13.  
  14. print(shells)
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement