#๐Ÿ”’ Is this a good thing?

21 messages ยท Page 1 of 1 (latest)

copper furnace
#

Trying out an online python interpreter for my programming class

median knollBOT
#

@copper furnace

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.

copper furnace
warped meteor
#

replit I take it?

viral crown
#

you get more out of it than some hosted version

slim stream
# copper furnace
  1. you don't call the function you defined
  2. you take an argument called incidentSeverity but immediately throw away and replace its value
  3. incidentSeverity is set to the literal string "enter severity level: ". did you mean to use input() there?
  4. you're comparing incidentSeverity to variables called minor, moderate, and severe. you didn't define these anywhere. most likely you wanted to make them strings, in which case you need to surround them with quotes.
copper furnace
#

I mean command prompt?

viral crown
copper furnace
vale ferry
#

@copper furnace that just says that they expect incidentSeverity to be a string. The input() function returns a string.

#

Oh, you don't need that line at all: you get given incidentSeverity when the function is called. Just use it.

#

i.e. remove incidentSeverity = str("enter security level: ') entirely, or move it out of the function.

copper furnace
#

Ok

#

Then just leave the rest of the code as is?

#

Or is there anything else I should change?

vale ferry
#

Other have pointed out that you're comparing to variables instead of strings, etc.

median knollBOT
#
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.