Comments (3)
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 passtext[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 toprint()
.
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.
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.
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)
- Landing page redesign
- Error on build-curriculum on Windows HOT 2
- Leaderboard and Interactive quizzes
- opensource graph.exe (www.padowan.dk) doesn't handle a _spawnl command from C++ HOT 1
- Learn How to Talk About Hobbies and Interests - Step 28 - rogue 'y' letter
- fix description for step 83 of calorie counter project HOT 1
- Updated UI for landing page HOT 7
- Update description for step 61 of pyramid project HOT 2
- Lesson assets should be served by the CDN HOT 3
- Remove '>>>' from Python editor HOT 2
- add more tests to rosetta code Tokenize a string with escaping HOT 2
- Use a darker color for the fCC logo in the donation animation HOT 2
- For MacOS, the submit button of the completion modal should display Command + Enter HOT 1
- Update assets for Music player project
- Update assets for legacy curriculum content
- Multifile editor - visual indication which editor is for which file HOT 1
- Glitches/slowness while coding
- Alignment Issue: Elements Misaligned on Homepage
- GET /api/users/get-public-profile
- Hover Effect: Underline Disappears on Hyperlink text HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freecodecamp.