You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python Code that Displays Addition, Subtraction, Division and Multiplication of 2 numbers
Initializing Variables x and y as 10 and 5 respectively
x=10y=5
Basic operators only requirement is having 2 variables with the operator symbol between
Addition example
add=x+y
Subtraction example
sub=x-y
Division example
div=x/y
Multiplication example
mul=x*y
Printing out the results
print(f'Addition of {x} and {y} is {add}')
print(f'Subtraction of {x} and {y} is {sub}')
print(f'Division of {x} and {y} is {div}')
print(f'Multiplication of {x} and {y} is {mul}')
Output:
Addition of 10 and 5 is 15
Subtraction of 10 and 5 is 5
Division of 10 and 5 is 2.0
Multiplication of 10 and 5 is 50