You've learned in the past lessons on how to use square root functions, right? Then let's take your knowledge to the test. Print out the square root of a given integer with only two decimal places.
Ready, solve, and go!
Input
A line containing an integer.
4
Output
A line containing a decimal with two decimal places.
2.00
NOTE: There are several test cases resulting in different values.
from math import sqrt
n = int(input())
n = round(sqrt(n), 2)
print('%.2f' % n)
Comments
Leave a comment