#๐Ÿ”’ help with a broken elif statment

10 messages ยท Page 1 of 1 (latest)

normal light
#

I am very new. Just working my way through a online lesson a friend suggested (kaggle) and been doing good so far tonight till i hit elifs. since it wasn't working i even tried copy/pasting theirs to see if it would owrk and it isnt.

def evaluate_temp_with_elif(temp):
if temp > 38:
message = "Fever!"
elif temp > 35:
message = "Normal temperature."
else:
message = "Low temperature."
return message

evaluate_temp_with_elif(36)

this keeps returning a blank. I think i broke visual studio again because last time i came here that was the problem lol

leaden templeBOT
#

@normal light

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

hardy salmon
#

!code

leaden templeBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

dusky condor
#

you're not doing anything with what's returned. You need to print it if you want to see it in your output

normal light
#

omfg

#

thank you haha

#

i added print and its working

leaden templeBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.