Fall 2024 - P3
3.6.1 Intro To Conditionals
Conditionals in both JavaScript and Python are used to execute code only if certain conditions are true. They allow programs to make decisions based on logical tests and are essential for controlling the flow of execution in programs.
Example of Python Conditionals
score = 85
if score >= 90:
print("A")
elif score >= 80:
print("B")
elif score >= 70:
print("C")
else:
print("F")