BdW44222

06. Electron Distribution

Jul 3rd, 2021
1,199
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. numbers_of_electrons = int(input())
  2. list_of = []
  3.  
  4. for shells in range(1, numbers_of_electrons + 1):
  5.     max_electron_numbers = 2 * shells ** 2
  6.     numbers_of_electrons -= max_electron_numbers
  7.     if numbers_of_electrons >= 0:
  8.         list_of.append(max_electron_numbers)
  9.         if numbers_of_electrons < max_electron_numbers and int(numbers_of_electrons) != 0:
  10.             list_of.append(numbers_of_electrons)
  11. print(list_of)
  12.  
RAW Paste Data