Ad
  • Default User Avatar

    You can use f strings. It doesn't require str(), and it looks more readable.

  • Default User Avatar

    Mapping str() onto list slices is more readable:

    map(str, n[:3])
    
  • Default User Avatar

    Yeah, this helps. Thank you very much!

  • Custom User Avatar

    ok i have changed it again hopefully its a bit clearer this time

  • Custom User Avatar

    "The unique position is the position of every different word in the sentence, which excludes repeated words"

    i was going to add this, do you reckon that's a good explanation? give suggestions if you have a better idea

    i want to keep it short and concise whilst not being too complex to understand

  • Custom User Avatar

    Ah ye, this kata was updated by someone else
    ill fix it when im home i promise

  • Default User Avatar

    Hey man! Sorry. Here's the example of what I mean:
    The test phrase The number 0 is such a strange number Strangely it has zero meaning

    • Regarding the AC the "Strangely" index is 8
    • Regarding the solution(s) the "Strangely" index is 7

    This happens due to the discrepancy of implementation and acceptance criteria:

    1. In AC we're suggested to add an index of an original sentence (as I read it)

    2. In acceptable solution to pass tests we:

      a. condense the sentense to unique set of strings;
      b. return indexes of those

    Which, in turn eliminates the repetition of the word "number" from the sentense making the index of "Strangely" = 7

    P.S. I am referring to a last assertion in "Basic tests" for the excersise.

  • Custom User Avatar
  • Custom User Avatar

    either you said the same thing as the wording
    or
    i have no clue what you just said

    please simplify what you just said, i cant comprehend it :(

  • Default User Avatar

    The issue here is that Acceptance Criteria provide the wording as
    If a word appears more than once in the sentence, your string should return the position of the first occurrence of the word.
    so you tend to reference the original sentence.

    Meanwhile tests and solutions show, that the "correct" approach is to treat and refer to the 1st occurance in condensed (no repetitions) array of words, which, coincidently, is expected to have the inherited order of the initial sentense.

  • Custom User Avatar

    Approved

  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Custom User Avatar

    i changed it to be less value. is this better

    "Your task is to make a program which takes in a sentence and returns a string which shows the position
    of each word in the sentence. If a word appears more than once in the sentence, your string should
    return the position of the first occurrence of the word. Capitalisation of words should be accounted for:
    'BEE' should be considered the same as 'bee'. The sentences include no punctuation."

  • Custom User Avatar

    i changed it to be less vague

    "Your task is to make a program which takes in a sentence and returns a string which shows the position
    of each word in the sentence. If a word appears more than once in the sentence, your string should
    return the position of the first occurrence of the word. Capitalisation of words should be accounted for:
    'BEE' should be considered the same as 'bee'. The sentences include no punctuation."

  • Custom User Avatar

    Not a valid suggestion

  • Loading more items...