Data Types
02 / شرح الدرس مكتوبًاmain.py
نص شرح المعلم والكود الذي كتبه ونتيجة تشغيله، بنفس ترتيب الدرس.
# ==========================================
# Python for Beginners
# Lecture 6: Data Types in Python
# ==========================================
# Lecture Contents:
# 1. What Are Data Types?
# 2. String (str)
# 3. Integer (int)
# 4. Float (float)
# 5. Boolean (bool)
# 6. Checking Data Types Using type()
# 7. Practical Example: Student Profile
# 8. Practice Task: About Me
# ==========================================
name = "Mohamed"
age = 20
grade = 9.6
is_student = True
#string =>str
name = "Mohamed" # "" or ''
country = "Cairo"
Street = "Nageb"
massage = "Welcome"
# print(name)
# print(country)
# print(Street)
# print(massage)
#integer => int
age = 20 # 20
student_count = -300 #price => 1.99 =>2
Student_Year = 2023
# print(age)
# print(student_count)
# print(Student_Year)
#float => float
age = 20 #20.00
price = -98.66
height = 197.5
average = 87.25
# print(price)
# print(height)
# print(average)
#Boolean => bool
is_student = True #Role == student == true || != False
is_graduted = False # 0 , 1
# print(is_graduted)
# print(is_student)
# print(type(is_student)) #bool
#Student Profile
student_name = "Mohamed" #str
student_age = 21 #int
student_grade = 66.3 #float
is_student = True #bool
print("Student Name :",student_name)
print("Student Age :",student_age)
print("Student Grade",student_grade)
print("IS Student?",is_student)
print(type(student_name))
print(type(student_age))
print(type(student_grade))
print(type(is_student))