Problem

7 /13


Referencing symbols

Theory Click to read/hide

Referring to row indices

Each character in a string has a number (called index), and numbering always starts from zero in many languages.
In Python, you can specify negative indexes. This means it counts from the end of the line.
 
Example 
String S H e l l o
Index S[0] S[1] S[2] S[3] S[4]
Index S[-5] S[-4] S[-3] S[-2] S[-1]

If you add the length of the string to the negative index, you get a "normal" character position.
 
Need to remember!
In Python, you cannot change a single character in a string, because strings themselves are immutable. 

Problem

The program receives two lines as input:
- the first line contains the word s;
- in the second - three integers a, b, c (each number is in the range [-len(s); len (s)-1])

Print a new word formed by the characters with indices a, bc (in that order)
 
Examples
# Input Output
1 computer science
2 3 4
fore