CODE
def main():
numbers()
add()
display()
def numbers():
num1 = int(input("Enter a number: "))
num2 = int(input("Enter another number: "))
return num1,num2
def add():
num1,num2 = numbers()
print(num1,"and",num2,"=",num1 + num2)
def display():
num1,num2 = numbers()
print("The numbers that you chose are",num1,"and",num2)
print("Both numbers added equal :", num1+num2)
main()
输出
Enter a number: 22
Enter another number: 22
Enter a number: 22
Enter another number: 22
22 and 22 = 44
Enter a number: 22
Enter another number: 22
The numbers that you chose are 22 and 22
Both numbers added equal : 44