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


#1

I didn't get it help please guys....!!!1


#2

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:
Joe


#3

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


#4

eventually u succeeded ?


#5

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:


#6

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
else:
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?


#7

Can you show the actual code you have?


#8

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


#9

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


#10

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


#11

Here's one of my answers.


#13

I hope this can help you


#14

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.


#15

thk u sooooo much, i tried putting actual numbers but i wanted the word answer​:joy:


#16

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!!!


#17

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


#18

I'm confused. :confused:


#19

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) ?


#20

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.


#21

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