Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
The provided code stub read two integers, a and b, 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.
a = 3
b = 5
0 0.6
The first line contains the first integer, a.
The second line contains the second integer, b.
Print the two lines as described above.
Sample Input 0
4 3
Sample Output 0
1 1.33333333333
a = int(raw_input())
b = int(raw_input())
print a/b
print a/float(b)
if __name__ == '__main__':
a = int(input())
b = int(input())
print(a//b)
print(a/b)
import sys
alls = []
for line in sys.stdin:
alls.append(int(line.strip()))
print alls[0]/alls[1]
print float(alls[0])/float(alls[1])
# Enter your code here. Read input from STDIN. Print output to STDOUT
num = int(input())
den = int(input())
print(num//den)
print(num/den)
In our experience, we suggest you solve this Python: Division Hacker Rank Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
Python: Division Hacker Rank Problem is available on Hacker Rank for Free, if you are stuck anywhere between a compilation, just visit Queslers to get Python: Division Hacker Rank Solution.
I hope this Python: Division Hacker Rank Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Hacker Rank, Leetcode, Codechef, Codeforce Solution.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Hacker Rank Problem & Solutions >>
Staircase Hacker Rank Solution
A Very Big Sum Hacker Rank Solution
Diagonal Difference Hacker Rank Solution