and
` keyword :# Using the and keyword
x = 5
y = 10
if x > 0 and y > 0:
print("Both x and y are positive.")
else:
print("At least one of x and y is not positive.")
Both x and y are positive.
and
` keyword to check if both `x
` and `y
` are positive. If both variables are greater than `0
`, the program will execute the code in the `if
` block, which prints the message "Both x and y are positive
." 0
`, the program will execute the code in the `else
` block, which prints the message "At least one of x and y is not positive
."and
` keyword to check if multiple conditions are true at the same time. This allows you to create more complex logical expressions.