Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 44 - test passes with wrong solution #248

Closed
isbushcar opened this issue Aug 15, 2022 · 1 comment
Closed

Exercise 44 - test passes with wrong solution #248

isbushcar opened this issue Aug 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@isbushcar
Copy link

isbushcar commented Aug 15, 2022

In exercise 44 expected solution is something like print(len(text[4:15].strip())), but the test passes with the first slice value from 4 to 8 (e.g. print(len(text[5:15].strip())) or print(len(text[8:15].strip()))).
That seems to happen because of \n and \t symbols that get cut anyway

В упражнении 44 ожидаемое решение - что-то вроде print(len(text[4:15].strip())), но тест проходит при указании первого значения слайса от 4 до 8 (например print(len(text[5:15].strip())) или print(len(text[8:15].strip()))).
Похоже это происходит из-за того, что символы \n и \t в любом случае обрезаются

@ashikov ashikov added the enhancement New feature or request label Aug 23, 2022
@mjh-sakh
Copy link

The task has 3 parameters that may be checked: start index, end index, and application of the strip. It is not possible to check both indexes and strip together. The current task checks two things: end index and strip application. It feels optimal as it's more likely to do a mistake with the end index. Therefore it is advised to accept the possibility to have the start index wrong and keep the example as is and close the issue.

@sgmdlt sgmdlt closed this as completed Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

4 participants