QuestionQ15

VerifiedComputer Programming and Python Fundamentals

You want to write a program that prompts the user for a value. For the remainder of the program, you need a whole number, even when the user enters a decimal value.

What would you need to write?

Explanation

input() returns a string. Applying float() accepts a decimal-form value, and applying int() to that numeric value converts it to an integer by truncating toward zero.

Community Discussion

No comments yet. Be the first to start the discussion!