7- You are creating an application which requires the user to input their password for logging into an account. Input is accepted using the input() function. What is the most appropriate approach to writing the code for type conversion of the input value and why? a. Convert to str, because we don't want the program to crash if the user inputs a number. b. Convert to float, since the input is a "floating" (non-permanent) value. c. Convert to float, since int only supports whole numbers. d. No type conversion necessary, since the Python interpreter will determine the best type for the value implicitly. e. Convert to int, since the input is an "intermediate" value. f. No type conversion necessary, since the input will already be the appropriate type for text (str).
7-
You are creating an application which requires the user to input their password for logging into an account. Input is accepted using the input() function. What is the most appropriate approach to writing the code for type conversion of the input value and why?
Convert to str, because we don't want the program to crash if the user inputs a number.
Convert to float, since the input is a "floating" (non-permanent) value.
Convert to float, since int only supports whole numbers.
No type conversion necessary, since the Python interpreter will determine the best type for the value implicitly.
Convert to int, since the input is an "intermediate" value.
No type conversion necessary, since the input will already be the appropriate type for text (str).
Step by step
Solved in 2 steps