Provide the one line of code in python for each of the following: 1. You are given a string from the user 2. Print the third character of this string. 3. Print the second last character of this string. 4. Print the first five characters of this string. 5. Print all but the last two characters of this string. 6. Print all the characters of this string with even indices (remember indexing starts at 0, so the characters are displayed starting with the first). 7. Print all the characters of this string with odd indices (i.e. starting with the second character in the string). 8. Print all the characters of the string in reverse order. 9. Print every second character of the string in reverse order, starting from the last one. 10. Print the length of the given string. Please number your answers (using the question numbers above) in your response. ALL QUESTIONS MUST BE IN PYTHON
Provide the one line of code in python for each of the following:
1. You are given a string from the user
2. Print the third character of this string.
3. Print the second last character of this string.
4. Print the first five characters of this string.
5. Print all but the last two characters of this string.
6. Print all the characters of this string with even indices (remember indexing starts at 0, so the characters are displayed starting with the first).
7. Print all the characters of this string with odd indices (i.e. starting with the second character in the string).
8. Print all the characters of the string in reverse order.
9. Print every second character of the string in reverse order, starting from the last one.
10. Print the length of the given string.
Please number your answers (using the question numbers above) in your response.
ALL QUESTIONS MUST BE IN PYTHON

Step by step
Solved in 4 steps with 2 images









