Computer Project File
Computer Project File
def ele_con():
global AtNo
orb = ['1s', '2s', '2p', '3s', '3p', '4s', '3d', '4p', '5s', '4d', '5p', '6s', '4f', '5d', '6p', '7s',
'5f',
'6d', '7p']
if AtNo == 24:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 5', '4s 1', sep=' , ')
elif AtNo == 29:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 1', sep=' , ')
elif AtNo == 41:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6', '4d 4', '5s 1', sep=' , ')
elif AtNo == 42:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6',
'4d 5', '5s 1', sep=' , ')
elif AtNo == 44:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6',
'4d 7', '5s 1', sep=' , ')
elif AtNo == 45:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6',
'4d 8', '5s 1', sep=' , ')
elif AtNo == 46:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6',
'4d 10', '5s 0', sep=' , ')
elif AtNo == 47:
print(' 1s 2\n', '2s 2\n', '2p 6\n', '3s 2\n', '3p 6\n', '3d 10\n', '4s 2\n', '4p 6\n',
'4d 10\n', '5s 1', sep=' , ')
elif AtNo == 57:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6', '4d 10', '5s 2',
'5p 6',
'5d 1', '6s 2', sep=' , ')
elif AtNo == 58:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6', '4d 10', '5s 2',
'5p 6',
'4f 1', '5d 1', '6s 2', sep=' , ')
elif AtNo == 64:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6', '4d 10', '5s 2',
'5p 6',
'4f 7', '5d 1', '6s 2', sep=' , ')
elif AtNo == 78:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6', '4d 10', '5s 2',
'5p 6',
'4f 14', '5d 9', '6s 1', sep=' , ')
elif AtNo == 79:
print(' 1s 2', '2s 2', '2p 6', '3s 2', '3p 6', '3d 10', '4s 2', '4p 6', '4d 10', '5s 2',
'5p 6',
'4f 14', '5d 10', '6s 1', sep=' , ')
else:
for i in orb:
if i._getitem_(1) == 's':
if AtNo <= 2:
print(i, AtNo)
break
else:
print(i, 2, end=' , ')
AtNo = AtNo - 2
if AtNo <= 0:
break
def elecon():
global AtNo
if AtNo <= 2:
if AtNo == 2:
print("Noble gas Electronic Configurations: ", AtNo)
else:
print("Electronic Configurations: ", AtNo)
elif 2 < AtNo <= 10:
if AtNo == 10:
print("Noble gas Electronic Configurations: 2 ,", (AtNo - 2))
else:
print("Electronic Configurations: 2 ,", (AtNo - 2))
elif 10 < AtNo <= 18:
if AtNo == 18:
print("Noble gas Electronic Configurations: 2 , 8 ,", (AtNo - 2 - 8))
else:
print("Electronic Configurations: 2 , 8 ,", (AtNo - 2 - 8))
elif 18 < AtNo <= 36:
if AtNo == 36:
print("Noble gas Electronic Configurations: 2 , 8 , 18 ,", (AtNo - 2 - 8 - 18))
elif 21 <= AtNo <= 30:
print("Electronic Configurations : Unavailable")
elif AtNo == 19 or 20:
print("Electronic Configurations: 2 , 8 , 8 ,", (AtNo - 18))
else:
print("Electronic Configurations : 2 , 8 , 18 ,", (AtNo - 2 - 18 - 8))
elif 36 < AtNo <= 54:
if AtNo == 54:
print("Noble gas Electronic Configurations: 2 , 8 , 18 , 18 ,", (AtNo - 2 - 8 -
18 - 18))
elif 39 <= AtNo <= 48:
print("Electronic Configurations : Unavailable")
elif AtNo == 37 or 38:
print("Electronic Configurations: 2 , 8 , 18 , 18 ,", (AtNo - 36))
else:
print("Electronic Configurations: 2 , 8 , 18 , 18 ,", (AtNo - 2 - 8 - 18 - 18))
elif 54 < AtNo <= 86:
if AtNo == 86:
print("Noble gas Electronic Configurations: 2 , 8 , 18 , 32 , 18 ,", (AtNo - 2 -
8 - 18 - 32 - 18))
elif 57 <= AtNo <= 80:
print("Electronic Configurations : Unavailable")
elif AtNo == 55 or 56:
print("Electronic Configurations: 2 , 8 , 18 , 32 , 18 ,", (AtNo - 54))
else:
print("Electronic Configurations: 2 , 8 , 18 , 32 , 18 ,", (AtNo - 2 - 8 - 18 -
32 - 18))
def symbol():
global AtNo
symb = ['H', "He", 'Li', "Be", "B", "C", "N", "O", "F", 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P',
'S', 'Cl', 'Ar', 'K',
'Ca', 'Sc', 'Ti', 'V',
'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', 'Sr', 'Y',
'Zr',
'Nb', 'Mo', 'Tc', 'Ru',
'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', 'La', 'Ce', 'Pr', 'Nd',
'Pm',
'Sm', 'Eu', 'Gd', 'Tb',
'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl',
'Pb',
'Bi', 'Po', 'At', 'Rn',
'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md',
'No', 'Lr',
'Rf', 'Ha', 'Unh', 'Ns',
'Hs', 'Mt', 'Uun', 'Uuu', 'Uub', 'Uut', 'Uuq', 'Uup', 'UUh', 'Uus', "Uuo"]
print('\n Atomic Symbol :', symb._getitem_(AtNo - 1), "\n\n Electronic
Configurations : --")
def give_the_final_result():
get_input = int(input("\n\t1. Get Electronic Configuration by Atomic No.\
\n\n\t2. Get Electronic Configuration by Atomic Symbol.\n\n(1/2)>>> "))
if get_input == 1:
get_input_at_no()
if 0 >= AtNo > 118:
print("Invalid Atomic No")
else:
elecon()
symbol()
ele_con()
print('\nAtomic No =', atno)
sleep(5)
elif get_input == 2:
get_input_at_sym()
elecon()
symbol()
ele_con()
print('\nAtomic No =', atno)
sleep(5)
else:
sleep(5)
print("\n Enter 1 or 2 not else..")
give_the_final_result()
def try_again_or_not(name):
inn = input(f'\n Try {name} \n (y/n)>>> ')
if inn.lower() == 'y':
give_the_final_result()
elif inn.lower() == 'n':
sleep(1)
else:
try_again_or_not('another')
give_the_final_result()
try_again_or_not('another')
except:
print("Invalid Input")
try_again_or_not('again')
sleep(5)
OUTPUT:
--- :Chemistry with Python = :) :--
(1/2)>>> 1
>>> 13
Electronic Configurations: 2 , 8 , 3
Atomic Symbol : Al
Electronic Configurations : --
1s 2 , 2s 2 , 2p 6 , 3s 2 , 3p 1
Atomic No = 13
Try another
(y/n)>>> y
(1/2)>>> 2
>>> FE
Atomic Symbol : Fe
Electronic Configurations : --
1s 2 , 2s 2 , 2p 6 , 3s 2 , 3p 6 , 4s 2 , 3d 6
Atomic No = 26
>>>
CASE STUDY
Introduction:
However, for many learners embarking on their journey into the realm of
chemistry, grasping the nuances of electronic configurations can prove to be a
daunting task. Traditional methods of learning often rely on memorization of
complex rules and manual calculations, requiring considerable time and effort to
master. This approach can present a significant barrier to entry for students,
hindering their ability to fully comprehend and appreciate the underlying
principles of chemistry.
In this case study, we will delve into the development, implementation, and
potential applications of our Python program, highlighting its role in enhancing
chemistry education and inspiring a new generation of scientists. By merging
the principles of chemistry with the versatility of programming, we endeavor to
break down barriers to learning and ignite a passion for discovery in the
captivating world of chemistry.
Problem Statement
Future Directions:
In summary, the benefits and applications of our Python program for retrieving
electronic configurations extend across educational, research, and outreach
domains, offering transformative opportunities for learners, educators,
researchers, and the general public alike. By harnessing the power of
technology to demystify chemistry and make it more accessible to all, we
contribute to a more informed and scientifically literate society poised to tackle
the challenges of the future.
References:
1. In the development of our Python program for retrieving electronic
configurations, we relied on a variety of resources and references to ensure
accuracy, reliability, and adherence to established scientific principles. Here are
the key references consulted during the development process:
2. Atkins, P., Overton, T., Rourke, J., Weller, M., & Armstrong, F. (2010). Shriver and
Atkins' Inorganic Chemistry (5th ed.). Oxford University Press.
3. This comprehensive textbook provided valuable insights into the principles of
inorganic chemistry, including electronic configurations and periodic trends.
4. Cotton, F. A., Wilkinson, G., Murillo, C. A., & Bochmann, M. (1999). Advanced
Inorganic Chemistry (6th ed.). Wiley.
5. A seminal work in the field of inorganic chemistry, this textbook served as a
reference for understanding complex electronic configurations and transition
metal chemistry.
6. CRC Handbook of Chemistry and Physics. (2022). CRC Press.
7. This authoritative reference work provided essential data on atomic properties,
including atomic numbers, atomic masses, and electron configurations.
8. NIST Chemistry WebBook. (n.d.). National Institute of Standards and Technology.
Retrieved from https://webbook.nist.gov/chemistry/
9. The NIST Chemistry WebBook offered a wealth of data and information on
chemical compounds, including electronic configurations, spectral data, and
thermochemical properties.
10. Python Software Foundation. (n.d.). Python Documentation. Retrieved from
https://docs.python.org/
11. The official Python documentation provided essential guidance and reference
materials for programming in Python, including syntax, data structures, and
standard libraries.
12. Stack Overflow. (n.d.). https://stackoverflow.com/
13. The Stack Overflow community served as a valuable resource for troubleshooting
programming issues, seeking advice on best practices, and learning from the
experiences of other developers.
14. Educational Institutions and Chemistry Departments: Various educational
institutions and chemistry departments provided online resources, lecture
materials, and tutorials related to electronic configurations and atomic structure.
15. By drawing upon these diverse sources of information and expertise, we ensured
the accuracy, reliability, and educational value of our Python program for
retrieving electronic configurations. Each reference contributed to the
development of a robust and scientifically sound tool for exploring the fascinating
world of chemistry.Top of Form