From 9f3ca1d15d017ccee43548c610147864443570b6 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Fri, 8 Feb 2019 18:07:23 +0000 Subject: [PATCH] added new test (for rosetta) --- tests/results/17 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/results/17 diff --git a/tests/results/17 b/tests/results/17 new file mode 100644 index 0000000..2822759 --- /dev/null +++ b/tests/results/17 @@ -0,0 +1,20 @@ +>>> s = 'abcdefgh' +>>> n, m, char, chars = 2, 3, 'd', 'cd' +>>> # starting from n=2 characters in and m=3 in length; +>>> s[n-1:n+m-1] +'bcd' +>>> # starting from n characters in, up to the end of the string; +>>> s[n-1:] +'bcdefgh' +>>> # whole string minus last character; +>>> s[:-1] +'abcdefg' +>>> # starting from a known character char="d" within the string and of m length; +>>> indx = s.index(char) +>>> s[indx:indx+m] +'def' +>>> # starting from a known substring chars="cd" within the string and of m length. +>>> indx = s.index(chars) +>>> s[indx:indx+m] +'cde' +>>>