Computer Science, asked by christincahcko5255, 8 months ago

The input() always returns a value of_______ type

Answers

Answered by venikrishna2918
13

Answer:

Function input() always returns string. If you want to check if input is integer and/or float you can try casting it to int/float using int(input("Please enter a String: ")) or float(input("Please enter a String: ")) and checking for ValueError exception.

Hope it is usefull.

Answered by Yashraj2022sl
0

Answer:

The input() always returns a value of String type.

Explanation:

The input() function stops the running of the application so that the user can enter a line of text using the keyboard. All entered characters are read after the user presses the Enter key and are returned as a string.

>>> user_input = input( "What is the capital of India?" )

What is the capital of India? Delhi

>>> name

'Delhi'

A string is always returned by input(). The built-in int(), float(), or complex() functions must be used to convert the string to the desired type if you want a numeric one.

So, the correct word is 'string' type.

#SPJ2

Similar questions