تفاضل سن پدر و پسر
برنامه ای بنویسید که سن پدر و پسری را از ورودی دریافت کند و تفاضل (تفریق) آنها را در خروجی چاپ کند
👨💻 1 ساعت قبل کاربر ناشناس این تمرین رو مشاهده کرد
برنامه ای بنویسید که سن پدر و پسری را از ورودی دریافت کند و تفاضل (تفریق) آنها را در خروجی چاپ کند
father_Age = int(input("Enter Father Age: "))
child_Age = int(input("Enter Child Age: "))
print("Age difference =", father_Age - child_Age)
def get_age(father_age, son_age):
fa_bo_age = father_age - son_age
if father_age < son_age:
print("The father's age cannot be less than the son's age, so please enter the correct information!!")
get_age(father_age=int(input("Please enter the father age: ")),son_age=int(input("Please enter the son age: ")))
else:
print(f"The result of the age difference between father {father_age} and son {son_age}, {fa_bo_age} is years.")
get_age(father_age=int(input("Please enter the father age: ")), son_age=int(input("Please enter the son age: ")))
a =int(input('age father:'))
f =int(input('age son'))
print(f -a)
#دریافت ورودی
X = int(input("Sen Pedar Ro Vared Kon:"))
Y = int(input("Sen Pesar Ro Vared Kon:"))
#محاسبه تفاضل
Z = X-Y
#خروجی
print(Z)
fatherAge=int(input("سن پدر را وارد کنيد:"))
sonAge=int(input("سن پسر را وارد کنيد:"))
differenceBetweenSonAndFather=fatherAge-sonAge
print("اختلاف سن پدر و پسر:",differenceBetweenSonAndFather)
age_father = float(input('agefather :'))
age_boy = float(input('ageboy :'))
resolut = age_father - age_boy
print(resolut)
boyage = 28 fatherage = 69 int( boyage ) int( fatherage) print ( fatherage - boyage)
rostam = int(input("age rostam: "))
sohrab = int(input("sohrab age: "))
resul = rostam - sohrab
print(resul)
a=int(input("Dad please enter your age:"))
b=int(input("Son please enter your age:"))
print("Your age difference is equal to:",a-b)
age1= int(input("boy:"))
age2= int(input("father:"))
print(age2 -age1)
جوابت را با Markdown بنویس و ثبت کن
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نامتوضیح کوتاهی بنویسید تا تیم بررسی کند.