+ 1
Using && in a If statement
I'm new on programming, in fact I just started learning, and I'm trying to use a condicional "If" but when defining the condition, I want to use the "&&" operator in order to define a lower and an upper límites, but when running the code it gives me an error saying unespected "<=" Is it because we cannot use "&&" when using "If"? If I remmove the "&&" and one of the limits the code runs without error.
5 odpowiedzi
+ 2
Please provide the code, your description is not very clear.
+ 2
Thanks, now I can see the bug 😉👍 You have to repeat the variable name for each sub-condition, like this:
if a > 0 && a <= 10
+ 1
It something like that, gives me a unnexpected "<=" error or something like that. I cant figure out wahts wrong
+ 1
What a silly mistake I made, lol thank you so much, my Head was a out to explode