= 2050
future_date = 2024
today = 20
age = age + (future_date - today)
age_then print('you will be', age_then, 'years old in', future_date)
you will be 46 years old in 2050
= 2050
future_date = 2024
today = 20
age = age + (future_date - today)
age_then print('you will be', age_then, 'years old in', future_date)
you will be 46 years old in 2050
= 40
hours = 10
per_hour_rate = hours * per_hour_rate
gross_pay print('you deserve:', gross_pay, 'SAR')
you deserve: 400 SAR
= 100
speed = 200
distance = distance / speed
time print('it will take you', time, 'hours to reach the destination')
it will take you 2.0 hours to reach the destination
import math
= 3
a = 4
b = 5
c
= (a + b + c) / 2
s = math.sqrt(s * (s - a) * (s - b) * (s - c))
area = 2 * area / c
h print('the height of the triangle is', h)
the height of the triangle is 2.4
إذا كنت تصرف في الشهر 1,000 ريال لقضاء حاجياتك، ثم اتبعت استراتيجية معينة، وأردت أن تحسب نسبة التغير في مصروفك، فكيف تعرف النسبة إذا نزلت إلى 650 ريال؟
= 1000
old_expense = 650
new_expense
= (new_expense - old_expense) / old_expense
percentage print(percentage * 100, '%')
-35.0 %
إذا كنت تمارس الرياضة وتزيد في وزن الحمل 10% أسبوعيًّا .. فإذا بدأت بوزن 20 كيلو، فإلى كم كيلوا ستصل في الأسبوع الرابع؟
= 1.10
increment
= 20
w1 = w1 * increment
w2 = w2 * increment
w3 = w3 * increment
w4
print(round(w4, 1))
26.6