The 'problem' is the
Plank's constant.
It (and the energy of the single photon) is very, very small (about 6 * 10
-34).
With the format you specified the code shows only zeroes.
This works for me
import scipy.constants as const
for f in range(1,10**5, 10**2):
energy=const.Planck*f
wavelength=const.c/f
print('{0:>18}'.format(f),'|'\
'{0:>18.7f}'.format(wavelength), '|', \
'{:>.2E}'.format(energy))
Output (excerpt of the)
(' 1', '| 299792458.0000000', '|', '6.63E-34')
(' 101', '| 2968242.1584158', '|', '6.69E-32')
(' 201', '| 1491504.7661692', '|', '1.33E-31')
(' 301', '| 995988.2325581', '|', '1.99E-31')
(' 401', '| 747612.1147132', '|', '2.66E-31')
(' 501', '| 598388.1397206', '|', '3.32E-31')
(' 601', '| 498822.7254576', '|', '3.98E-31')
(' 701', '| 427663.9914408', '|', '4.64E-31')
(' 801', '| 374272.7315855', '|', '5.31E-31')
...