تفاضل سن پدر و پسر
برنامه ای بنویسید که سن پدر و پسری را از ورودی دریافت کند و تفاضل (تفریق) آنها را در خروجی چاپ کند
👨💻 1 ساعت قبل کاربر ناشناس این تمرین رو مشاهده کرد
برنامه ای بنویسید که سن پدر و پسری را از ورودی دریافت کند و تفاضل (تفریق) آنها را در خروجی چاپ کند
a = int(input("Father's Age: "))
b = int(input("Son's Age: "))
print(a-b)
age_f = int (input("age father:"))
age_b = int (input("age boy:"))
t = age_f - age_b
print (t)
# مرحله اول سن پسر را دریافت میکنیم
pesar = int(input('sen pesar ra vared konid : '))
# در مرحله دوم سن پدر را دریافت میکنیم
pedar = int(input('sen pedar ra vared konid : '))
# در مرحله سوم تفاضل بین سن هارا محاسبه میکنیم
tafazol = ( pedar - pesar )
# در مرحله چهارم پاسخ بدست امده را پرینت میکنیم
print ( '=' , tafazol )
x = int(input("enter age dad :"))
y = int(input("enter age sun :"))
print("age dad - age sun =", x-y)
print("{Age Difference}")
ab = int(input("Father's Age: "))
cd = int(input("Son's Age: "))
print(ab - cd)
# Calculate the age difference between father and son
fatherAge = int(input("Enter the father age. "))
sonAge = int(input("Enter the son age. "))
formula = (fatherAge - sonAge)
output = print("The age difference between father and son is",formula,"years.")
father_age = int(input("Enter father's age:"))
son_age = int(input("Enter son's age:"))
if son_age > father_age :
( print("It is not possible that son being older than his father."))
elif son_age == father_age :
( print("Father and son cannot have the same age."))
elif son_age < father_age :
age_differece = father_age - son_age
print(f"The father is {age_differece} years older than his son.")
fatherage, sonage = [int(x) for x in input(
"enter father's age nad son's age (seperated with ','):").split(',')]
print(f"The age difference between father and son is equal to {fatherage - sonage}")
pedar=int(input('sen bedar ra vared konid?'))
pesar=int(input('sen besar ra vared konid?'))
x=pedar-pesar
print(f'age sen pedar {pedar} va sen pesar {pesar} tafavot seni onha {x}')
#گرفتن سن پدر و پسر
F=int(input('Enter Your Age Father:'))
S=int(input('Enter Your Age Son:'))
#تفریق سن انها و چاپ نتیجه جواب
print( F - S )
جوابت را با Markdown بنویس و ثبت کن
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نامتوضیح کوتاهی بنویسید تا تیم بررسی کند.