Python: Division

I received an email message from HackerRank suggesting a Python challenge. The challenge is described in the following URL:

Following is the output from a console using Visual Studio 2013 Professional with the PTVS (Python Tools for Visual Studio) plug-in using the sample input data:

4 <== input data

3 <== input data



Press any key to continue . . .

The actual code is short and simple (you could call it trivial):

if __name__ == ‘__main__’:

# **** read input ****

a = int(input())

b = int(input())

# **** divide and print ****

print(a // b)

print(float(a) / float(b))

The solution passed the 2 test cases.

If you have comments or questions regarding this or any other post in this blog please do not hesitate and send me an email message. I will reply as soon as possible not making use of your name unless you explicitly tell me to do so.


Follow me on Twitter: @john_canessa

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.