Why won't VSC multiply my code and why cant I use the INPUT statement in codeacademy

In VSC i keep getting the answer of 185 (the first value i put for “Weight”. It doesn’t update “weight” based off of the users input. Here is my code

venus = .91

mars = .38

jupiter = 2.34

saturn = 1.06

uranus = .92

neptune = 1.19

planet = input(“What planet are you fighting on?”)

weight = 185

if planet == 1:

weight = weight * venus

elif planet == 2:

weight = weight * mars

elif planet == 3:

weight = weight * jupiter

elif planet == 4:

weight = weight * saturn

elif planet == 5:

weight = weight * uranus

elif planet == 6:

weight = weight * neptune

print(“Your weight:”, weight)

Hi,
input takes in a string, and your if statements are comparing it to an int.
You could either change your if statements. e.g;
if planet == “1”:
or ‘cast’ planet to an int. e.g.;
planet = int(input("What…
Though that would give you an error if you entered something non-numeric.

Hope that helps

1 Like

It did! thank you for the help, I really appreciate it

1 Like