Python #3 : Arithmetic Operations
This is the 3rd blog in our series of HackerRank Python solutions, where we will be solving new problems of Python on our blogs, and you can solve it with me or after you have understood the problem.
So without wasting much more time we will be going to dive directly into the code.
So inside this problem we have to perform multiple operations, and show all the results. As you can see in the image below, we will take two input numbers from the user i.e., a & b.
So we have three task, firstly to add both of them, secondly to subtract 2nd number from 1st and at last we have multiply both of them. Well we here have two ways to solve either we directly print once, that will be like following :
print( a + b )
print( a - b )
print( a * b )
Else we can assign seperate variables to these values, as following :
Sum = a + b
Difference = a - b
Multiply = a * b
So this is how we will be getting our next solution.
Now it totally depends on you how you want to solve the problem, if you have any other method pr way in which we can solve this problem, let me know in the comment, we will surely implement it.
Till then, #Coders😎
Recent Posts
See AllMy last blogg about gaming from your android, or my other blogs, that I published earlier were not a big hit, not like this website or...
Comments