e=int(input("Enter number of protons = "))
en=e
ep=e
csh=0
ece=['1s','2s','2p','3s','3p','4s','3d','4p','5s','4d','5p','6s','4d','5p','6s','4f','5d','6p','7s','5f','6d','7p']
s=0
c=0
m=0
eceo=[]
ecep=[]
eces=[]
gr=0
num=[0,'¹','²','³','⁴','⁵','⁶','⁷','⁸','⁹','¹⁰','¹¹','¹²','¹³','¹⁴']
sup=['¹⁴','¹³','¹²','¹¹','¹⁰','⁹','⁸','⁷','⁶','⁵','⁴','³','²','¹']
if e==24:
c=1
ecep.append('1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d⁵')
print(""" Electronic configuration(Shell wise) = 2,8,8,6
Electronic configuration(Subshell wise) = 1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d⁵
Electronic Configuration(Noble Gas Wise) = [Ar]4s¹,3d⁵
Atomic Number = 24
Number of Electrons = 24
Number of Protons = 24
Oxidation State = 1,2,3,4,5,6
Period = 4
group = 6""")
elif e==29:
c=1
ecep.append('1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d¹⁰')
print("""Electronic Configuration(Shell wise) = 2,8,8,8,3
Electronic Configuration(Subshell wise) = 1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d¹⁰
Electronic Configuration(Noble Gas Wise) = [Ar]4s¹,3d¹⁰
Position in period Table = Period-4,Group-11
Atomic Number = 29
Number of Electrons = 29
Number of Protons = 29
Oxidation State = 1,2,3
Period = 4
Group=11""")
if c!=1:
print("Electronic Configuration(Shell wise) = ",end="")
while en>0:
csh+=1
if csh==1:
en=en-2
if en>=0:
eces.append(2)
elif en<0:
eces.append(1)
else:
en=en-8
if en>=0:
eces.append(8)
elif en<0:
eces.append(8+en)
for i in range(0,len(eces)):
if i==len(eces)-1:
print(eces[i])
else:
print(eces[i],end=",")
print("Electronic Configuration(Subshell wise) = ",end="")
while e>0:
if ece[s][1]=='s':
e=e-2
if e>=0:
ecep.append(ece[s])
ecep.append(sup[-2])
elif e<0:
ecep.append(ece[s])
ecep.append(sup[-1])
s+=1
elif ece[s][1]=='p':
e=e-6
if e>=0:
ecep.append(ece[s])
ecep.append(sup[-6])
elif e<0:
ecep.append(ece[s])
ecep.append(sup[-(6-abs(e))])
s+=1
elif ece[s][1]=='d':
e=e-10
if e>=0:
ecep.append(ece[s])
ecep.append(sup[-10])
elif e<0:
ecep.append(ece[s])
ecep.append(sup[-(10-abs(e))])
s+=1
elif ece[s][1]=='f':
e=e-14
if e>=0:
ecep.append(ece[s])
ecep.append(sup[0])
elif e<0:
ecep.append(ece[s])
ecep.append(sup[-(14-abs(e))])
s+=1
for i in range(0,len(ecep)):
if i==len(ecep)-1:
print(ecep[i],end='')
elif i%2!=0:
print(ecep[i],sep='',end=',')
else:
print(ecep[i],end='')
if ecep[len(ecep)-2]=='s':
g=sup.index(ecep[len(ecep)-1])
print()
for i in range(0,len(ecep)):
m+=1
if 9>=ep>1:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[He]',end="")
if i>1:
print(ecep[i],end="")
elif 17>=ep>9:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Ne]',end="")
if i>5:
print(ecep[i],end="")
elif 35>=ep>17:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Ar]',end="")
if i>9:
print(ecep[i],end="")
elif 53>=ep>35:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Kr]',end="")
if i>15:
print(ecep[i],end="")
elif 85>=ep>53:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Xe]',end="")
if i>21:
print(ecep[i],end="")
elif 117>=ep>85:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Rn]',end="")
if i>31:
print(ecep[i],end="")
elif 127>=ep>117:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Og]',end="")
if i>39:
print(ecep[i],end="")
print()
print("Atomic Number =",ep)
print("Number of Electrons =",ep)
print("Number of Protons =",ep)
if len(eces)>3:
print("Oxidation = ",end="")
for i in range(1,eces[len(eces)-1]+1):
if i==eces[len(eces)-1]:
print(i,end="")
else:
print(i,end=",")
else:
if eces[len(eces)-1]<=4:
print("Oxidation State =",eces[len(eces)-1])
else:
print("Oxidation State =",8-eces[len(eces)-1])
for i in range(0,len(ecep)):
eceo.append(ecep[i])
grp=ecep[len(ecep)-3::1]
sr=[]
for i in range(0,len(ecep)):
if ecep[i][0].isdigit():
sr.append(ecep[i])
sr.sort()
print()
j=-1
for i in range(0,len(grp)):
for j in range(0,len(grp[i])):
if grp[i][j]=='s':
gr=num.index(grp[-1])
elif grp[i][j]=='p':
gr=num.index(grp[-1])+10+num.index(grp[-3])
elif grp[i][j]=='d':
gr=num.index(grp[-1])+num.index(grp[-3])
print("Group =",gr)
print("Period =",grp[1][0])