2(x)
What will be the output of the code given below:
text = "Python Programming" print(text[7:])
Show SolutionHide Solution↓
Programming
In Python, if the ending index is not mentioned in string slicing, the slice returns characters from the starting index up to the end of the string. Here, text[7:] starts from index 7 and returns all characters till the end, resulting in Programming.