beteween 2 if statements there must be a and, or?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bot7

var example = 10
var example_2 = 11

func _ready():
if example == 10 and example_2 == 11:
print(“hello World”)

#is this with the “and” right ?

:bust_in_silhouette: Reply From: jgodfrey

Yeah, that’s correct. But, that’s not really 2 if statements. That’s a single if statement that’s testing multiple expressions. And, yeah, you connect those with and or or. With and connections, all of the tested expressions must be true for the if code block to be executed. With or connections, at least one of the expressions must be true for the if code block to be executed.

Thank you for answering.

Bot7 | 2020-12-21 19:24