Assign two random numbers ‘x’ & ‘y’ and then print addition, subtraction, division, and multiplication.

This is a python code to perform basic arithmetic operations.

Contents

Python Program

Here is the code:

#Generate two random numbers ‘x’  & ‘y’ and then print addition, subtraction, division, and multiplication.

x = 4
y = 6
print('X = ',x)
print('Y = ', y)

print('X + Y = ', x + y)
print('X - Y = ', x - y)
print('X * Y = ', x * y)
print('X / Y = ', x / y)
print('X % Y = ', x % y)

# This code is contributed by Ahmad Shafiq

Program Output:

callout-flag

Love this read? Subscribe to Modernage!

Do you have any queries? You can ask in the comments. We, at Modernage answer each and every question, asked in the comments, so If you have any queries, or you want to know about any specific platform you can ask in the comments below

Author

Leave a Reply

girl-carrying-document

More Articles.

girl-carrying-document

More Articles.