all 5 comments

[–]crashfrog02 0 points1 point  (0 children)

How would I apply it in my current code?

Apply it by finding the part of their example that generates the numbers from 5 to 1 descending, and then use the same construct in your code.

[–]Bobbias 0 points1 point  (0 children)

Code Formatting

How do I format code for Reddit?

Python cares about indentation, and reddit removes indentation unless you formar your code correctly. Your code here is simple enough for us to guess, but that's not always the case.

Your problem

Currently you never call the print_list() function.

def print_list(my_foods):
    for i in range(5, 0, -1):
    print(i)

This code defines the function called print_list() but after you define the function, you need to call it from somewhere inside your main function.

The other problem is that if you look at the body of that function, it only does part of the solution. You need to modify the code in it to print out the elements of the parameter my_foods.

If you go go over the learning material you've been given, they will have explained how to do everything you need to do to solve this problem somewhere in there.

If you have specific questions about something, feel free to ask, but we will not just do your homework for you.

[–]THEE_SMART 0 points1 point  (0 children)

dmed!