top of page
Writer's pictureKrunal Chandan

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😎

7 views0 comments

Recent Posts

See All

Last Blogg For KNBLOGGS

My 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


About Us

LOGO_MAIN.jpg

Welcome to KN Blogg, the place where we're serious about tech, finance, movies, and games. Or at least, we try to be. We're a team of self-proclaimed experts, enthusiasts, and sometimes just plain clueless individuals, who love to share our thoughts, opinions, and occasional witty remarks with the world.

Posts Archive

Tags

bottom of page