I am struggling with the Lasagna exercise

The instructions are really complicated for something supposed to be simple and there is too much clutter.

I dont understand what I am supposed to do

2 Likes

Is there any part in particular you’re having trouble with?

Is there a specific test which is failing for you?

Running the tests is supposed to help highlight what is broken and next needs fixing.

The exercise stub has a handful of TODO comments indicating what is needed:

# TODO: define the 'EXPECTED_BAKE_TIME' constant

# TODO: consider defining the 'PREPARATION_TIME' constant
#       equal to the time it takes to prepare a single layer

# TODO: define the 'bake_time_remaining()' function

# TODO: define the 'preparation_time_in_minutes()' function
#       and consider using 'PREPARATION_TIME' here

# TODO: define the 'elapsed_time_in_minutes()' function

The instructions have five corresponding tasks:

  1. Define expected bake time in minutes
  2. Calculate remaining bake time in minutes
  3. Calculate preparation time in minutes
  4. Calculate total elapsed cooking time (prep + bake) in minutes
  5. Update the recipe with notes

More specifics about which part is giving you trouble would be helpful :slight_smile:

I ended up figuring out what to do. It’s been a while since I’ve done Python and completely forgot what what docstrings were (been using Javadocs).

Stuff like that can be bit of information overload to me and might make be found to a halt.

Hi! I’m stuck with that exercise (number 5) and i don’t know how to solve it .

AssertionError: unexpectedly None : Expected a docstring for bake_time_remaining, but received None instead.

I really appreciate some help
Have a nice day!

Hi @Daropx :wave:

The tests for task 5 are looking for docstrings in all your functions. If no docstring is found for a function, an unexpectedly None error gets thrown.

Here’s an example of a docstring from the PEP linked above:

Note how the block is indented directly under the function definition, and is enclosed in triple double quotes. You’ll be seeing a lot of these docstrings in the other concept exercises. They’re often used to describe input/return types, and the purpose of a function (or class).

Docstrings can be extracted by documentation systems to automatically form documentation for a project. They can also (with some special syntax) be written as lightweight unit tests or functional specifications. See doctest if you are curious. :smile:

1 Like

Hello Isaac, i would like to say that the exercise is really overwhelming and the instructions just so complicatd, i couldn’t do the exercise and the quit exercism from frustration, i came back later but i think that was just my luck but but i think this exercise really need to be changed to something which is definately better, i think a tuturial on the first exercise would also be great. Thank you

Duly noted. Is there any part in particular you had difficulty with?

Thank you @BethanyG!!!

just the instructions and it took a bit of time to figure out other things but anyways i think the instructions need to be simplified

2 Likes

Which part of the instructions? Every sentence? What do you think the instructions should be like? “All of it is hard” is pretty vague, which makes it hard to improve any of it.

Do you have a concrete diff to propose, @Jawad6942?

Diff blocks are written like

```diff
  Preceding line.
- To be removed.
+ To be added.
  Following line.
```

and render like

  Preceding line.
- To be removed.
+ To be added.
  Following line.

@Jawad6942

As the maintainer of the Python track (and the author of said exercise version) - what @IsaacG and @MatthijsBlom are asking would be tremendously helpful to me.

Having specific suggestions or quotes of what is confusing and why, with proposals for how to clarify would be really really helpful.

Also – Isaac and Matthijs: if either of you have proposals on how to clarify, I’d welcome them. Although (at this time) I don’t want to break the exercise up into parts.

1 Like

I went over it again just now and no infelicities jumped out to me, except perhaps that it is not tested that the functions depend on EXPECTED_BAKE_TIME (which could be done by substituting it and checking that the behavior changes).

Oooh. good catch. I am actually in that exercise right now fixing a few other bugs #3161 and #3181, so maybe I will try to think through adding a test there. Thank you, Matthijs!

(edited to add) - although, if EXPECTED_BAKE_TIME is omitted, an import error is thrown, so that is “sort of” a test. But it would be nice if we could make that less of an error and more of a test failure…I’ll think on it. :smile:

Im also really struggling with the exercise and i have been stuck for weeks, i need help please

What are you struggling with? What is your exact code? What is the exact error message? You can use a codeblock to share code on the forum:

```
code and errors go between three backticks
```

what I found confusing was that everything should be encapsulated in function, nothing really hard but it was confusing when I started. Exercise is pretty basic, but still feel like instructions were not clear. Can’t help to explain better though

Tasks 2, 3, 4 all start with:

Implement the something() function …

Does that need to be more clear in some manner or stress that the task requires you fill out a function?

2 Likes

You know, my first programming language that I learned was C. I had no tutors, just a keen eye for excellent writing. Even after finding one VERY good book on the subject that helped me understand pointers (on a college short course later the instructor warned us, if you are going to write code that could possibly be used to guide missles to targets in this nuclear age we are living in, please really KNOW pointers – when pointers go astray with missles, Cities DIE!) I still would run into problems hard to figure out. But then I heard about a practice of using a Rubber Duck! Seriously, a Rubber Duck! You talk to the duck, explain what you are given, what is supposed to happen to what you were given, what you did to make that happen and what is the result when you tried those things. I think if you did that here you would understand what is goin wrong.

ahh thank you and ok so let me recal from my momory maybe this will help but the instructions first of all getting the whole bakery senario in head was overwhelming, i think the variable names could use improvement, maybe shorten them up and you know how is their this pannel of code under task saying import lasagna and stuff and yea that was confusing too cuz i kept on trying to look at it but apparently that had nothing to do with what i had to write.

In a whole getting the bakery exercise in my head as begginer was confusing. it wasnt hard but everything was just not straight forward and it took me time to figure things out (which was frustrating). I also struggled with the overwheling information on page 1, i think its too much inforamtion to the point it gets confusing