Operator Precedence

جارٍ التحميل…

01 / ملخص الدرس

Operator Precedence

ضمن مساربايثون للمبتدئين10 / 11
02 / شرح الدرس مكتوبًا

نص شرح المعلم والكود الذي كتبه ونتيجة تشغيله، بنفس ترتيب الدرس.

main.py
# ==========================================
# Python for Beginners
# Lecture 10: Operator Precedence
# ==========================================

# Lecture Contents:
# 1. What Is Operator Precedence?
# 2. Multiplication vs. Addition
# 3. The Role of Parentheses
# 4. Order of Operations
# 6. Practice Task

# ==========================================

#() , ^ , * / , + -
# 2*6/ 2
#2/2*6
#v+v+v-vvv(2*69-6+45)

# resulte = 2+6*2 #6*2 = 12 , 12+2 =14
#2 +6 =8 , 8 *2 =16

resulte =2+(6*2/2-5)/2
#(6*2/2-5) =>6*2 = 12, 12/2 = 6, 6-5 = 1 , 2+ 1/2 ,1/2 =0.5 ,0.5 +2 =2.5

resulte = 2+3*4 #3*4 =12. 12 +2 =14
resulte = (2+3)*4 #2+3 =5 , 5 *4 =20
03 / دروس المسار (11)
  1. 01Introduction
  2. 02Print
  3. 03Comments
  4. 04Type of data
  5. 05Variables
  6. 06Data Types
  7. 07Type Casting
  8. 08Basic Arithmetic Operators
  9. 09Advanced Arithmetic Operators
  10. 10Operator Precedenceانت هنا
  11. 11Shopping Calculator