round() in python by R4R Team

- round() is a python function which is use for round off the given value.
- It take one argument which is of number type, either integer, float,double
- Return round off value

Example -
number is 3.12
rounded number will be 3

number is 3.78
rounded number will be 4

program-

print("Enter any number")
a=float(input())
print("Rounded number is "+str(round(a)))

print("Enter another number")
a=float(input())
print(" Rounded value is "+str(round(a)))


output-

Enter any number
3.12
Rounded number is 3
Enter another number
3.78
Rounded value is 4

Enter any number
98.5
Rounded number is 98
Enter another number
98.6
Rounded value is 99


-In this program, we take a float number as a input and print the round off value for each number with the help of round() function.

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!