درس 6 من 10
الشروط
تستخدم if و elif و else لاتخاذ قرارات في Python. المقارنات مثل == و > تعيد True أو False.
PYTHON
score = 85
if score >= 90:
print("Grade A")
elif score >= 80:
print("Grade B")
elif score >= 70:
print("Grade C")
else:
print("Grade D")
# شرط مركب
if score >= 60 and score < 70:
print("Almost there")