Switch and if/else

Hello, fellow campers,

What is the real difference between Switch and If statement

Thanks and Happy Coding!

switch cases are rigid and streightfoward, one variable equal to a value
if statements have conditions much more flexible

1 Like

What you mean by this?

in a switch you can just compare a variable to a series of values

1 Like