Skip to content
← Back to Community
Else if program
Profile icon
Ktark

I'm running an else if program that in theory does your taxes. Whenever I input a value for my income it only does the first set of parameters even if it doesn't belong to it

Voters
Profile icon
Ktark
Comments
hotnewtop
Profile icon
AugustPeterson

I haven't done code in a little bit so I'm not the absolute best answer but you have to make the else if statements a part of the if statement by doing:

if (this happens){
print(print this)
else if (this happens){
print(print this)
} """<= the end of else if statements inside of an if statement"""
else if (this happens){
print(print this)
else{
print(print this)
} """<= the end of the else statement at the end of the if statement"""
} """<= the end of the last else if statement"""
} """<= the end of the if statement"""

I actually came here for help with else if statements so I may be completely wrong lol.