Giter VIP home page Giter VIP logo

Comments (3)

pkdvalis avatar pkdvalis commented on June 14, 2024

Most of the language for instructions is explicit and needs to be followed exactly. If we make this question more flexible that might set an expectation of flexibility in answers going forward. The code needs to be consistent with the beginning of Step 14 as well, which does not have print()

What if the instructions were modified to explicitly ask the result to be printed?

At the end of your code, call .find() on your alphabet string and pass text[0] to the method. Note that a method is just a function that belongs to an object (you will learn more about that in another project). Print the result by writing this line in a call to print().

print() has already been introduced at this point, but would this be too complex for Step 13? This is the 13th step in the first project for Python. As it stands, this result is eventually printed in Step 15.

This means if the user uses print() here step 14 would also need to be updated.

In step 14 print() would be removed and the result assigned to a variable instead.
In step 15 we print the variable.

from freecodecamp.

Dario-DC avatar Dario-DC commented on June 14, 2024

Considering that the result of .find() will be printed after two steps, I'd keep the current sequence of steps:

  • step 13: alphabet.find(text[0])
  • step 14: index = alphabet.find(text[0])
  • step 15: print(index)

Regarding the strictness, probably calling print should not prevent campers from proceeding to the next step. As @a2937 pointed out, there are several steps in which this occurs and I think we should try to be consistent.

Although regex tests can be easily modified to allow the code with the print call to pass, we are switching to ast-based helpers to write tests, and I don't see an easy way to do the same in this case. The AST structure is different and we cannot take into account every time that campers might decide to print something where the instructions don't ask for that.

from freecodecamp.

zairahira avatar zairahira commented on June 14, 2024

The campers are expected to enter the code that is asked in the instruction and tests would run according to that. I believe, anticipating more test cases beyond what is expected wouldn't be possible. Also, provided we are using AST based helpers( that test very specific outputs), adding further flexibility wont be possible.

from freecodecamp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.