Previous

Hacker Rank Test - 3

Next

Task

The provided code stub reads two integers,  and , from STDIN.

Add logic to print two lines. The first line should contain the result of integer division,  a//b . The second line should contain the result of float division,  a/b .

No rounding or formatting is necessary.

Answer

if __name__ == '__main__':
    a = int(input())
    b = int(input())
    
    # Integer division of 'a' by itself (always 1 if a != 0)
    print(a // a)  
    
    # Floating-point division of 'a' by 'b'
    print(a / b)