KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

What will be the output of the code given below:

text = "Python Programming" 
print(text[7:])

Python List Manipulation

2 Likes

Answer

Programming

Working

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.

Answered By

3 Likes


Related Questions