-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (25 loc) · 1.05 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
''' --RUN THIS FILE--
Main method - I chose to contain it in a main function bc I'm a c++ guy
Constructs an atom, and runs down its decay chain
@author Silas W
@version 6-5-2024
'''
import element
def main():
print("Hello? Would you like to make an element!")
lmnt = element.Element(input("How many protons? "), input("How many neutrons? "), input("How many electrons? "))
print("Name: " + lmnt.getName())
print("Symbol: " + lmnt.getSymbol())
print("Charge: " + str(lmnt.getCharge()))
print("Stable? " + ("Probably" if lmnt.getStable() == 0 else "Unlikely"))
print("Orbitals: " + lmnt.getOrbitals())
while (not(lmnt.getStable() == 0) and input("Simulate decay? [enter] ") == ""):
print()
lmnt.decay()
print("Protons: " + str(lmnt.p))
print("Neutrons: " + str(lmnt.n))
print("Name: " + lmnt.getName())
print("Symbol: " + lmnt.getSymbol())
print("Charge: " + str(lmnt.getCharge()))
print("Stable? " + ("Probably" if lmnt.getStable() == 0 else "Unlikely"))
main()