Python Programming - Console Input/Output - Discussion

Discussion Forum : Console Input/Output - General Questions (Q.No. 54)
54.
How can you prompt the user to enter a floating-point number and round it to the nearest integer?
float(input("Enter a number: ")).round()
round(float(input("Enter a number: ")))
int(input("Enter a number: "))
round_int(input("Enter a number: "))
Answer: Option
Explanation:
To prompt the user to enter a floating-point number and round it to the nearest integer, use round(float(input("Enter a number: "))).
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.