freeCodeCamp

Tutorial

freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source platform for learning programming and math for free.

Overview

freeCodeCamp is a donor-supported nonprofit offering a comprehensive curriculum in web development, data science, and more. It features interactive challenges, projects, and certifications. The community-driven platform helps thousands transition into tech careers.

README Preview

[](https://www.freecodecamp.org/)\n\n[](https://www.firsttimersonly.com/)\n[](https://discord.gg/PRyKn3Vbay)\n[](https://insights.linuxfoundation.org/project/freecodecamp/repository/freecodecamp-freecodecamp)\n\n## freeCodeCamp.org's open-source codebase and curriculum\n\n[freeCodeCamp.org](https://www.freecodecamp.org) is a friendly community where you can learn to code for free. It is run by a [donor-supported 501(c)(3) charity](https://www.freecodecamp.org/donate) to help millions of busy adults transition into tech. Our community has already helped more than 100,000 people get their first developer job.\n\nOur full-stack web development and machine learning curriculum is completely free and self-paced. We have thousands of interactive coding challenges to help you expand your skills.\n\n## Table of Contents\n\n- [Certifications](#certifications)\n- [The Learning Platform](#the-learning-platform)\n- [Reporting Bugs and Issues](#reporting-bugs-and-issues)\n- [Reporting Security Issues and Responsible Disclosure](#reporting-security-issues-and-responsible-disclosure)\n- [Contributing](#contributing)\n- [Platform, Build and Deployment Status](#platform-build-and-deployment-status)\n- [License](#license)\n\n### Certifications\n\nfreeCodeCamp.org offers several free developer certifications that make up the [Full-Stack Developer Curriculum](https://www.freecodecamp.org/learn/full-stack-developer-v9/):\n\n- [Responsive Web Design](https://www.freecodecamp.org/learn/responsive-web-design-v9/)\n- [JavaScript](https://www.freecodecamp.org/learn/javascript-v9/)\n- [Front-End Development Libraries](https://www.freecodecamp.org/learn/front-end-development-libraries-v9/)\n- [Python](https://www.freecodecamp.org/learn/python-v9/)\n- [Relational Databases](https://www.freecodecamp.org/learn/relational-databases-v9/)\n- [Back-End Development and APIs](https://www.freecodecamp.org/learn/back-end-development-and-apis-v9/)\n\nEach of these certifications involves completing interac

FAQ (5)

Troubleshooting
Why does Medical Data Validator Step 9 reject `isinstance(dictionary, dict) == False`?

The Step 9 test currently expects the condition to use not isinstance(dictionary, dict). Although comparing the Boolean result to False is logically equivalent, it does not match the accepted test pattern. Replace the condition with:

if not isinstance(dictionary, dict):
    print(f'Invalid format: expected a dictionary at position {index}.')
    is_invalid = True

This detects the same non-dictionary values and passes the Step 9 tests. A curriculum fix has been proposed to accept equivalent type-check expressions.

GitHub Issue #70800
Troubleshooting
How to fix “IndexError: string index out of range” and ValueError when converting input() to an integer in Python?

Python sequences are zero-indexed. "hello world" has 11 characters at indexes 0 through 10; index 11 is already past the end, so greet[11] raises IndexError: string index out of range. Use greet[-1] for the last character or len(greet) - 1 for its index.

Also, input() always returns a string. The error occurs only when that string cannot be converted with int(), such as entering letters or a blank value. Handle it with try/except:

greet = "hello world"
print(greet[10])   # d
print(greet[-1])   # d

try:
    number = int(input("Enter a number: "))
except ValueError:
    print("Please enter a valid integer!")

GitHub Issue #70748
Troubleshooting
How do I fix the freeCodeCamp Implement a Stack tests when my functions follow LIFO but the argument or collection-order tests fail?

The tests call the stack operations as standalone functions. The stack object returned by initStack() is passed as the first argument, and push also receives the new element as its second argument. Store items in stack.collection, with the last array element treated as the top of the stack.

Example implementation:

function initStack() {
  return { collection: [] };
}

function push(stack, element) {
  stack.collection.push(element);
}

function pop(stack) {
  return stack.collection.pop();
}

function peek(stack) {
  return stack.collection[stack.collection.length - 1];
}

function isEmpty(stack) {
  return stack.collection.length === 0;
}

function clear(stack) {
  stack.collection.length = 0;
}

After push(stack, 'first') and push(stack, 'second'), the test expects stack.collection to equal ['first', 'second']. Do not add or remove items at index 0 with unshift()/shift(). The original user stories omitted these calling conventions and collection-order requirements; a pull request updates the instructions.

GitHub Issue #70686
Troubleshooting
Why is the freeCodeCamp back-end course container stuck on 'Preparing the course' with bash '$\r': command not found error?

The error is caused by Windows-style CRLF (\r) line endings being added to ./bash/sourcerer.sh and ./bash/.bashrc when cloning the repo on Windows (outside WSL). The repo files themselves use LF endings, so this is a local Git configuration issue. Fix options:

1. Prevent Git from converting line endings, then re-clone the repository:

git config --global core.autocrlf false

Then delete the back-end-development-and-apis directory and clone it again.

2. Or strip the carriage returns from the affected files inside the container:

sed -i 's/\r$//' ./bash/sourcerer.sh ./bash/.bashrc

You can verify invisible characters with sed -n 'l' ./bash/sourcerer.sh. After fixing the line endings, run the freeCodeCamp: Run Course command again — the course should load normally. If you develop on Windows, working inside WSL avoids this problem entirely.

GitHub Issue #71378
informational
Are website breadcrumbs based on site hierarchy or the user's browsing history?

The breadcrumbs in the freeCodeCamp lesson represent the page's position in the site hierarchy, not the user's actual route. For example, Home / Electronics / Phones / Smartphone XYZ means those pages are parent sections in the site structure; a user arriving directly from search should see the same trail. Do not describe breadcrumb links as necessarily "previously visited pages." History-based breadcrumbs, which track the actual path taken, are a separate and less common pattern and should be explicitly labeled as such. Main navigation links may be shortcuts to nested categories, so they do not have to correspond only to top-level hierarchy levels. Follow the W3C ARIA breadcrumb pattern and use a dedicated <nav> element, such as <nav aria-label="Breadcrumb">, for the hierarchical trail.

GitHub Issue #70779