Most of us seem to be stuck at the if, elif and else exericies (99 problems and Big if). Can someone please solve the questions so that we learn what we are doing wrong? or provide better hints?
Personally, I think this lesson is pay back for racing through the module, and those previous at break-neck speed like there is some reward for swiftness. I have news for anyone in this picture. It's not about swiftness, but comprehension and being able to follow instructions.
Anybody having trouble with this exercise needs to go back to the beginning and do a complete review and practice some more. The expectation of this exercise is so rudimentary around the fundamentals it couldn't be any simpler.
The instructions are clear about what is expected and what to use in the exercise.
- if elif else
- and or not
Those are the expected elements in the code, and the final proviso that the function MUST return True. How hard can that be?
If the confusion is in understanding the material (i.e. conditionals, booleans, comparators) required in this problem, then I would side with the previous commenter, mtf. However, I definitely would not use the same patronizing tone as mtf. You, codemaster71049, have an honest and common question, so you deserve a respectful answer.
The truth hurts, but I don't mean it as patronizing. Only a flat out fact as given in the evidence. I make no apology.
Posted solutions will be summarily removed.
You have no right to remove anything mtf . the real problem with this exercise is return part. and it has nothing to do with basics!
It has everything to do with basics. There is no harm is starting over and getting a better understanding of them. Better that than carrying forward in this course with a total lack of understanding.
Hi folks, I'm having trouble phrasing my condition (or to really know what options I have). I just reviewed the lessons again and it's not quite sticking. My instinct is to put an argument into the_flying_circus and then say if the argument is - or - then return true elif the argument is not - or - return false. But that's not right.
Can someone clearly [re]state in different words what kinds of things i can write for my conditions. It can be a number expression...or something else?
Some more simple examples than provided in the lessons would be really helpful.
The sky is the limit. No restrictions. We can use boolean expressions, numeric expressions or string expressions, so long as we use a range of operators and logic.
Write two expressions that both yield True, then plug them into the if elif else.
Things to avoid:
- Remember, no argument so write and call with ().
if something == True:
if somthinng == False:
if something: in the case of
if not something: in the case of
not may not be written alone between operands.
A not B # invalid A and not B # valid A or not B # valid
Recall order of precedence and if using numerics, order of operations. Lastly, never write a conditional expression in the ELSE branch.
I will add that there is no restriction on the use of variables inside the function. Define and use any you wish. It's not our code that matters so much as the output, and the use of required elements.
Come on dude. To be fair, lesson 15 is using functions which haven't been explained, and its in a review section. Also, when were return statements explained? They weren't. Your explanation doesn't help anyone, its just belittling. This is the problem with code academy. Its a fun way to learn, however, they don't teach fundamentals or basics at all. They barely describe anything. I was able to get this to work easily, however, I was also able to pass garbage meaningless code through it as well, which means, if someone learning is able to do that, they don't gain anything off of accidentally passing something through for the wrong reasons.
Seriously, there has been more fervor stirred up over this exercise than can fit in a novella. Read through the forums. The Big If is by far one of the most notorious. It floors me. Every concept in this exercise is covered beforehand. And what it asks for is downright simple. I'm not talking down, or belittling, this is just the fact of the matter. Plain and simple.
Codecademy is the site where the learning is supposed to take place. These are just the forums that do not have any CC staff on the moderator team operationally. We are all volunteers, not teachers, and certainly not paid. We answer questions like any other member, since after all, that is what we are... Members.
Policy number one is to not get personal. Ranting is not going to change anything. Attacks on members will come with consequences, so keep those jets cool.
Now that I've finally tracked down the lesson (so few members think to post a link) I see that Functions are not introduced until the next module. However, this one is already set up, and there is no actual instruction to call the function. Only the SCT calls it. So it's all internal and nothing for us to fret about.
The focus should be on the if statement. That is all the instructions point to. Even the structure is there for us. All we need to do is turn our attention to the two condtional expressions and
return True from all three branches.
return do? Finish this module without further delay and find out in the next unit.
I really struggled too but once you get it its quite simple.
Try to just put in some statements whether mathematical or boulian and return true or false as your action
I was able to get this to work just fine. I just didn't appreciate the fact that its under a section titled "review" and uses two new concepts not discussed yet. I think that could really throw someone off who is learning. MTF, sorry, just joined (although I think I made an account a long time ago). Will try to be more civil.
Personally, I like to take these lessons outside of the browser and try to add to them, such as the pig latin course at the end of the next lesson (gave it a for loop that has you try again if you answer incorrectly, then closes after three incorrect tries with a terminating message). So I can appreciate new unexplained concepts sprinkled into lessons, just not under a review section, as it is misleading and creates the feeling that you missed something or aren't comprehending something, since its a review of what you should have learned.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.