I Got 99 Problems, But a Switch Ain't One

I didn’t get it help please guys…!!!1

1 Like

Hi arcace59459!
I would be happy to help! But first I need to know what you need help with.
Looking at your screenshot it looks like you have not attempted the problem.
Did you need help understanding the question? Or are you looking for guidance getting started solving the problem?
Let me know how I can best help you out ! :slight_smile:

1 Like

@arcace59459 Please try the exercise first. Read the directions and make an attempt at it before asking for help from others. :slight_smile:

eventually u succeeded ?

I never had a problem in the exercise to begin with, that was directed to @arcace59459. Do you have a problem with your code? If so, please post your code and error message. :slight_smile:

The instructions are as follows:
On line 2, fill in the if statement to check if answer is greater than 5.
On line 4, fill in the elif so that the function outputs -1 if answer is less than 5.

def greater_less_equal_5(answer):
if ________:
return 1
elif ________:
return -1
return 0

print greater_less_equal_5(4)
print greater_less_equal_5(5)
print greater_less_equal_5(6)

So, on line 2 I put variations like something to give me greater than 5 and less than 5 in order to trigger the elif. On line 4 I used something to get a number less than 5.

The error was that my return values were incorrect.

What are the instructions saying in laymen’s terms?

1 Like

Can you show the actual code you have?

Guys thanks I have done it but I needed help with the instructions because I didn’t know what to do.

1 Like

i did everything and i know what to do first, but then i reset the code.@chipjumper36731

screenshot your code please… so i can help you.xx

Here’s one of my answers.

I hope this can help you


Yes it does. Thanks. I didn’t fully understand what I was being asked to do. I understand based on your example that the word in the parenthesis was determining what should be greater than or less than. Great help.

thk u sooooo much, i tried putting actual numbers but i wanted the word answer😂

i did the same thing without adding in the word “answer”. so i kept getting an error i was getting upset too thank you. you helped me without even knowing it!!!

OMG you are a genius! I’ve been sitting here for half an hour trying to figure this out!
Thank you!:grin::hamburger:

I’m confused. :confused:

answer is compared to 5 this I get it, but what is the value of answer ?
Is it comparing the length of the variable against 5 (like: len(answer) > 5) ?

This is a super confusing instruction set as you can see from the feedback above. There is no variable “answer” so I think folks started trying to put in expressions to meet the requirements. Might want to tweak the instructions so they are a bit clearer.

1 Like

I need help with the if/else problem DUDE!!!