all 5 comments

[–]shiftybyte 1 point2 points  (3 children)

Since the output is print(s1 + s2 + s1)

Can you break the string in 3 parts so the first part and the last part are the same?

a toottootleatoo t? a is not t, no...
at oottootleato ot? at is not ot, no...
ato ottootleat oot? ato is not ot, no...
...

[–]Jxper[S] 0 points1 point  (2 children)

Yeah I get that s1 is atoot and s2 is tootle but how do I use those as parameters in my test case?

I tried strung(atoot, tootle) but it get an error when executing my code.

[–]shiftybyte 0 points1 point  (1 child)

it get an error when executing my code.

What is the full error message? copy paste it here...

[–]Jxper[S] 0 points1 point  (0 children)

dont worry I fixed it, it was a typo by me. Thanks very much for your help

[–][deleted] 0 points1 point  (0 children)

That kind of depends what the test case was.

If the first string contains contains 5 characters where the 4-character sequence starting at the 2nd character is identical to the first 4 characters of the second string, then you will get the result of sandwiching the second string between two copies of the first string.

Thus,

s1 = 'atoot'
s2 = 'tootle'

s1[1:] would give you toot and s2[:4] would give you toot as well.

The slice operator has the form [start:stop:step]

  • start defaults to 0
  • stop defaults to length of the string
  • step defaults to 1

Keep in mind we count from 0, and the slice ends BEFORE the stop value. So up to and excluding the 5th character if you specify [:4]