العوامل المنطقية logical operators in python من خلال الثلاث كلمات المحجوزة في لغة بايثون (and,or,not) يمكن إجراء فحص مركب من خلال الشرط if, حيث لابد من تحقق أكثر من شرط أو إحدي الشرطين لإجراء بعض الأوامر.
تحقق جميع الشروط لإجراء تنفيذ الأوامر
age = 17 gender = "female" member = True if age >= 18 and gender=="male" and member == True: print("welcome to my my application") else: print("you not allowed to use this application")
تحقق شرط من إحدى الشروط لإجراء تنفيذ الأوامر
age = 17 gender = "female" member = True if age >= 18 or gender=="male" or member == True: print("welcome to my my application") else: print("you not allowed to use this application")
التحقق من عدم تحقق الشرط لتعود بالقيمة المنطقية True
age = 17 gender = "female" member = True print(not(gender == "female" and age >=18 ))
- روابط هامة لكورس لغة بايثون
- المتغير variable python
- انواع البيانات data type python
- if condition in python
- for loop in python
- while loop in python
- arithmetic operators in python
- assignment operators in python
- comparison operators in python
- logical operators in python
- identity operators in python
- input command in python
- array collection in python
- list in python
- tuple in python
- set in python
- dictionary in python
- iterators in python
- function in python