import matplotlib.pyplot as plt
def spectra(n1, n2):
rh = 1.097e7
inv_lambda = rh * ((1 / (n1**2)) - (1 / (n2**2)))
wavelength = 1 / inv_lambda * 1e9
return wavelength
n1 = 1
n2 = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
wave = [spectra(n1, n) for n in n2]
plt.figure(figsize=(10, 2))
for w in wave:
plt.axvline(x=w, color='red', linestyle='-', linewidth=1)
plt.xlabel('Wavelength (nm)')
plt.title('Lyman Series')
plt.show()
aW1wb3J0IG1hdHBsb3RsaWIucHlwbG90IGFzIHBsdAoKZGVmIHNwZWN0cmEobjEsIG4yKToKICAgIHJoID0gMS4wOTdlNwogICAgaW52X2xhbWJkYSA9IHJoICogKCgxIC8gKG4xKioyKSkgLSAoMSAvIChuMioqMikpKQogICAgd2F2ZWxlbmd0aCA9IDEgLyBpbnZfbGFtYmRhICogMWU5CiAgICByZXR1cm4gd2F2ZWxlbmd0aAoKbjEgPSAxCm4yID0gWzIsIDMsIDQsIDUsIDYsIDcsIDgsIDksIDEwLCAxMV0Kd2F2ZSA9IFtzcGVjdHJhKG4xLCBuKSBmb3IgbiBpbiBuMl0KCnBsdC5maWd1cmUoZmlnc2l6ZT0oMTAsIDIpKQpmb3IgdyBpbiB3YXZlOgogICAgcGx0LmF4dmxpbmUoeD13LCBjb2xvcj0ncmVkJywgbGluZXN0eWxlPSctJywgbGluZXdpZHRoPTEpCnBsdC54bGFiZWwoJ1dhdmVsZW5ndGggKG5tKScpCnBsdC50aXRsZSgnTHltYW4gU2VyaWVzJykKcGx0LnNob3coKQ==