PRO
Jesus
asked
N
Expert
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()âxis a stringx = input("...")âxis 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.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer
