Build a Kitchen Inventory Tracker - Step 17

Tell us what’s happening:

Why is my code not being successful? Whenever i check it, it says “Indentation error” even when i give four spaces gap.

Your code so far

available_eggs = 1
available_flour = 2
available_sugar = 3

def check_kitchen_stock():
    total_items = available_eggs + available_flour + available_sugar
    print(f'The kitchen has {total_items} total items:')
    print(f'- {available_eggs} eggs')
    print(f'- {available_flour} flour')
    print(f'- {available_sugar} sugar')

check_kitchen_stock()

def use_eggs(available_eggs, eggs_to_use):
    if eggs_to_use > available_eggs:
        print('The kitchen does not have enough eggs.')
        return available_eggs

    print(f'{eggs_to_use} egg(s) used out of {available_eggs} available.')
    return available_eggs - eggs_to_use

use_eggs(available_eggs, 1)
print(available_eggs)

def make_fried_egg(available_eggs):
    has_enough_eggs = available_eggs >= 1

    if has_enough_eggs:
        available_eggs = use_eggs(available_eggs, 1)
        print('Made a fried egg. Yummy!')
    else:
        print('Could not make a fried egg. Not enough eggs!')

    return available_eggs

# User Editable Region
available_eggs = make_fried_egg(available_eggs)

def check_kitchen_stock():
# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36

Challenge Information:

Build a Kitchen Inventory Tracker - Step 17

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-kitchen-inventory-tracker/6a3eaa2caac22f67811fe40f.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @Spotme,

You have already defined check_kitchen_stock in your code. Now you just need to call that function again like you did earlier in your code.

Happy coding

Alright! Solved. Thank you.