0
python if statements
Task:take the integer temp in celcius as input and output boiling water if the temperature is above or equal to 100 Sample input is 105 My code: temp=int(input(105) If temp>=100 print(‘Boiling’)
11 ответов
+ 8
What is your question?
I think your code won't work:
* number from input()
* missing closing ) of int()
* if is spelt wrong ("If" is not correct)
* : in after the if-condition is missing
* print() is not indented into the if-block
+ 2
It should work, if you remove the 150 in input and add one ) on the first line.
Add a : at the end of the if statement.
And you should indent the print statement.
+ 2
Remove 105 and put : after line 2
+ 2
Please have another look at my previous comment and look at how "if" is spelt and where : needs to be placed
The ' in your printed string don't look right...
+ 1
Thank you
+ 1
I fugured it out thank you very much i may ask noob question but im still only a begginer just learning
+ 1
# just write it like this:
temp = int(input())
if temp > 100:
print('Boiling')
else:
print('Stable')
# but you can make a one-line version of it:
(temp > 100 and print('Boiling')) or print('Stable')
#this will evaluate the value of int(input()) and it can be thought as: (True/False & True) or True
0
Okay i know fixed the code
temp=int(input(105))
If:temp>=100
print(‘Boiling’)
What am i missing now??
0
I removed 150 still wrong idk why
0
Oh i put : after 100? At 2nd line??
0
This code is not work.Because your code is not correct.Some problems in your code.