Can you help me please😰.. slove this code..😩😱😢 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Can you help me please😰.. slove this code..😩😱😢

Build program code to solve this problem. Test whether the temperature entered is a cold, medium or hot temperature where the cold temperature is 25 ° c and below, the medium temperature is between 26 ° c to 40 ° c, while the hot temperature is 41 ° c and above. is this code correct .... which I have create it😅🙃🤔 https://code.sololearn.com/cQ5zd03634Cx/?ref=app

22nd Aug 2021, 10:46 AM
NURUL AIN SYAFIQAH BINTI MUHAMMAD NAZIR
NURUL AIN SYAFIQAH BINTI MUHAMMAD NAZIR - avatar
11 Answers
+ 12
NURUL AIN SYAFIQAH BINTI MUHAMMAD NAZIR , since you have finished the tutorial "python for beginners" you should be able to correct your code by yourself. read the error messages and debug your code step by step. some of the issues: ▪︎ no input() function uesd ▪︎#include temperature ??? ▪︎missing colon at the end of conditional statement >> if ... else ... ▪︎float temp ; incorrect syntax, no need to declare variables this way ▪︎no need to have semicolon at the end of a line ▪︎incorrect use of >> else ▪︎...
22nd Aug 2021, 11:00 AM
Lothar
Lothar - avatar
+ 7
Your code has many flaws, does not look like Python at all. Python is dynamically typed, you do not need to declare variables along with their type. The type is guessed by the runtime, when the value is assigned to the variable. You need to ask for user input with the input() function, and because it is a string, you convert it with the float() function. In your conditions you need to use elif except for the last one.. the conditions don't have to be in parentheses. if condition: ... elif condition2: ... else: ... And we don't use any semicolons in Python.
22nd Aug 2021, 11:01 AM
Tibor Santa
Tibor Santa - avatar
+ 6
temp = float(input())
22nd Aug 2021, 11:03 AM
Tibor Santa
Tibor Santa - avatar
+ 3
#Try this code: temp = float(input()) print("Input days temperature : "+str(temp)); if temp<0: print("Freezing weather."); elif temp<10: print("Very cold weather."); elif temp<20: print("Cold weather.\n"); elif temp<30: print("Normal in temp."); elif temp<40: print("Its Hot."); else: print("Its very hot.");
22nd Aug 2021, 11:18 AM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
+ 3
MD. Ferdous Ibne Abu Bakar Thank you very much...😄😊😉👍👍👍
22nd Aug 2021, 11:22 AM
NURUL AIN SYAFIQAH BINTI MUHAMMAD NAZIR
NURUL AIN SYAFIQAH BINTI MUHAMMAD NAZIR - avatar
+ 3
Your code has many flaws, does not look like Python at all. Python is dynamically typed, you do not need to declare variables along with their type. The type is guessed by the runtime, when the value is assigned to the variable. You need to ask for user input with the input() function, and because it is a string, you convert it with the float() function. In your conditions you need to use elif except for the last one.. the conditions don't have to be in parentheses. if condition: ... elif condition2: ... else: ... And we don't use any semicolons in Python.🙃🙃
23rd Aug 2021, 2:29 PM
Suchismita
Suchismita - avatar
+ 2
Hello
23rd Aug 2021, 2:24 PM
Alexlulu
+ 2
suhu = float(input()) print("Masukan suhu : "+str(suhu)) if suhu<=25: print("cold") elif suhu<=40: print("moderate") elif suhu>40: print("hot") __try this method
23rd Aug 2021, 2:29 PM
Ahamed Sheriff
Ahamed Sheriff - avatar
+ 1
Tibor Santa How to do that..😰😕
22nd Aug 2021, 11:02 AM
NURUL AIN SYAFIQAH BINTI MUHAMMAD NAZIR
NURUL AIN SYAFIQAH BINTI MUHAMMAD NAZIR - avatar
+ 1
Welcome
22nd Aug 2021, 1:02 PM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
+ 1
remember that in 25 it is still cold....
23rd Aug 2021, 2:40 PM
Christopher Guerra Herrero
Christopher Guerra Herrero - avatar