تفاضل سن پدر و پسر
برنامه ای بنویسید که سن پدر و پسری را از ورودی دریافت کند و تفاضل (تفریق) آنها را در خروجی چاپ کند
👨💻 1 ساعت قبل کاربر ناشناس این تمرین رو مشاهده کرد
برنامه ای بنویسید که سن پدر و پسری را از ورودی دریافت کند و تفاضل (تفریق) آنها را در خروجی چاپ کند
a = input(" sen pedar ra vared kon : ")
age_father = int(a)
b = input(" sen pesar ra vared kon : ")
age_son = int(b)
difference = age_father - age_son
print ( " age_father :" , age_father )
print ( " age_son :" , age_son )
print ( " difference of age :" , difference )
father = (input("sene pedar ra vared konid: "))
son = (input("sene khod ra vared konid: "))
father = int(father)
son = int(son)
print("tafazol shoma va pedare shoma be bedin sorat ast =" , father - son)
fatherage=float(input (" (سن یکم)سن مورد نظر را وارد کنید: "))
boyage=float(input("(سن دوم)سن مورد نظر را وارد کنید:"))
print("تفاضل سن :",fatherage-boyage)
sp=(int(input("sen pedar: ")))
sp0=(int(input("sen pesar: ")))
print(sp-sp0)
father = float(input("father: "))
boy = float(input("boy: "))
print(father - boy)
# تفاضل سن پدر و پسر
a = int(input("Enter the father's age: "))
b = int(input("Enter the boy's age: "))
if a > b:
print("Age difference = " , a - b)
else:
print("Error. The father's age must be older than the son's age!")
agefather = int(input("enter your number age father:"))
ageboy = int(input("enter your number age boy:"))
ekhtelaf = agefather - ageboy
print(f"ekhtelaf father and boy:{ekhtelaf}")
a = float(input("سن پدر را وارد کنید "))
print(a)
b = float(input("سن پسر را وارد کنید "))
print(b)
c = float(input("اگه پسر دوم هم دارید این جا سنش را وارد کنید اگه ندارید صفر بنویسید "))
print(c)
d = (a-b-c)
print("تفاضل سن پسر و پدر شما هست ")
print(d)
name= int (input("sen pedar="))
name2= int (input("sen pesar="))
print("faseleh sen=" , name - name2)
print ("How much would you be if you subtracted your age from your father's?")
khodet = int(input("sen khodet!:"))
pedaret = int(input("sen pedaret:"))
print ("the result",pedaret - khodet)
جوابت را با Markdown بنویس و ثبت کن
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نامتوضیح کوتاهی بنویسید تا تیم بررسی کند.