Jesus Rodriguez
PRO
3 days ago
Jesuscountry asked

I know writing input("Enter temperature in Celsius") will save the input value as a string. Is it the same when I write just input() with no prompt inside the parentheses? Will the input value still be saved as a string regardless?

N
Expert
3 days ago
Nisha Sharma answered

Hello there, good question.

Yep, it still works the same. input() always takes what the user types and gives it back as a string. Adding something like input("Enter temperature in Celsius: ") only shows a message on the screen. It doesn’t change how the value is stored.

So:

  • x = input() → x is a string

  • x = input("...") → x is still a string

That’s why we usually do float(input()) here, so you can actually do the Celsius-to-Fahrenheit math.

Feel free to reach out if you have any more queries.

Python
This question was asked as part of the Learn Python Basics course.