Quiz on string slicing

Question 1: What is the result of string[2:6] for string = "Aftermath" in Python?





Question 2: Which of the following is the correct way to slice the string "Aftermath" to get "ret"?





Question 3: What does string[::-1] do for string = "Aftermath" in Python?





Question 4: What is the result of string[::2] for string = "Aftermath" in Python?





Question 5: How do you slice the string "Aftermath" to get "After"?





Question 6: What is the result of string[3:] for string = "Aftermath" in Python?





Question 7: What is the result of string[-3:-1] for string = "Aftermath" in Python?





Question 8: What is the result of string[-1::-1] for string = "Aftermath" in Python?





Question 9: What is the result of string[6:1:-2] for string = "Aftermath" in Python?





Question 10: How do you slice the string "Aftermath" to get "mat"?