correct the following code
temperature = input("TEMPERATURE: ")
if temperature > 90:
print " It is hot outside."
Answers
Answered by
2
Explanation:
temperature = int (input ("temperature"))
if (temperature > 90) :
print ("it is hot outside")
input func takes input as a string type by default. so you've to use the type converter int() to change that value to integer, which can then be compared with 90.
if you don't want to use int(), then you've to compare temperature with "90"
(temperature > "90") ie with string type.
keep the indentation right.
Similar questions
Science,
3 months ago
Math,
3 months ago
Sociology,
8 months ago
Computer Science,
8 months ago
Math,
1 year ago