Skip to content

Commit 9f3ca1d

Browse files
committed
added new test (for rosetta)
1 parent b0e7ac4 commit 9f3ca1d

File tree

1 file changed

+20
-0
lines changed
  • tests/results

1 file changed

+20
-0
lines changed

tests/results/17

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
>>> s = 'abcdefgh'
2+
>>> n, m, char, chars = 2, 3, 'd', 'cd'
3+
>>> # starting from n=2 characters in and m=3 in length;
4+
>>> s[n-1:n+m-1]
5+
'bcd'
6+
>>> # starting from n characters in, up to the end of the string;
7+
>>> s[n-1:]
8+
'bcdefgh'
9+
>>> # whole string minus last character;
10+
>>> s[:-1]
11+
'abcdefg'
12+
>>> # starting from a known character char="d" within the string and of m length;
13+
>>> indx = s.index(char)
14+
>>> s[indx:indx+m]
15+
'def'
16+
>>> # starting from a known substring chars="cd" within the string and of m length.
17+
>>> indx = s.index(chars)
18+
>>> s[indx:indx+m]
19+
'cde'
20+
>>>

0 commit comments

Comments
 (0)