The age of the father and the son
Write a program that receives the age of father and son from the input and prints them (subtraction) in the output
Write a program that receives the age of father and son from the input and prints them (subtraction) in the output
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
# Get user input for father's age and son's age a = int(input("Enter the father's age: ")) # Corrected the typo in the prompt b = int(input("Enter the son's age: ")) # Prompt for son's age # Calculate the age difference d = a - b # Print the result print("Here is your result: ", d)
X=int(input("father's age: ")) Y=int(input("boy's age: ")) print(X-Y)
dadage = int(input("a: ")) sonage = int(input("b: ")) print(dadage-sonage)
tool = int(input("tool")) arz = int(input("arz")) print(tool * arz)
fatherAge=int(input("please set father age: ")) sonAge=int(input("please set son age: ")) print("minus =",fatherAge-sonAge)
a =int(input("sen pedar:")) b = int(input("sen pesar:")) tafazol = (a - b) print("tafazol,sen=" ,tafazol)
age1 = input('father age: ')
age2 = input('son age: ')
age1 = int(age1)
age2 = int(age2)
print(age1 - age2)
Submitting answers is currently unavailable.
Write a program that receives 2 numbers as the interval, in which the interval of all the 5 existing numbers. For example, in the interval of 1 to 20 the number 2 times the number 5 repeated (5 and 15)
Write a program that receives the user's name from the input and prints the following welcome message what is your name: amirhossein welcome amirhossein
Write a program that receives a text from the input and, like the example below, prints from the first to the first point Enter: My name is amirhossein. I live in tehran. My name is amirhossein
Write a program that receives a number and from that number to 0 countdown is required between each number of 1 second pauses
Write a program that receives an infinite number from the user and when the user entered the number 0; Print all numbers entered from large to small in the output
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.