I'm a begginer and I am trying to recreate the modern periodic table in Python. For some reason, it shows a syntax error for my elif statement which seems to be perfectly fine to me. I use VS Code as my primary editor, so I copy pasted the code to sublime text and even it shows the same issue. Can anyone identify the isuue and help me fix the issue. I've attached the code below and the error it shows.
ERROR:-
'elif e=='Li' or e=='lithium':
^
SyntaxError: invalid syntax'Thanks in advance.
CODE:-
elif e=='Li' or e=='lithium':
from mendeleev import Li
print('Name: ', Li.name)
print('Symbol: ', Li.symbol)
print('Atomic Number: ',Li.atomic_number)
print('Group:', Li.group)
print('Period: ', Li.period)
print('Block: ', Li.block)
print('Valence Electrons :', Li.nvalence())
print('Atomic Mass: ', Li.atomic_weight)
print('Electronic Configuration: ', Li.ec.conf)
print('E.C in shells:', Li.ec.electrons_per_shell()
Screenshot:
elif
without anif
.)
at the end