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