0

What is wrong with my python code? I get a line 3 stynax error

atomicNumber = input ("") protons = input("") neutrons = 'atomicNumber' - 'protons' print (neutrons)

16th Oct 2018, 8:14 PM
pixel strength
pixel strength - avatar
1 Antwort
0
What you get from input is a string , so you are trying to subtract two strings, which isn't correct. Just convert what you get from input to a number, ie: atomicNumber=int(input('')) and same for protons
16th Oct 2018, 10:03 PM
fra
fra - avatar