Answer Posted / chaitanya
The sequences in python are indexed and it consists of the positive as well as negative numbers. The numbers that are positive uses ‘0’ that is uses as first index and ‘1’ as the second index and the process goes on like that. The index for the negative number starts from ‘-1’ that represents the last index in the sequence and ‘-2’ as the penultimate index and the sequence carries forward like the positive number. The negative index is used to remove any new-line spaces from the string and allow the string to except the last character that is given as S[:-1]. The negative index is also used to show the index to represent the string in correct order.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the ideal naming conventions in python?
What is a python constant?
How do I sort alphabetically in python?
What is os module?
How to implement an 'enum' in python?
List out loop breaking functions?
What is ord () in python?
Tell me what is flask & its benefits?
What is pythonpath?
What is python's slice notation?
Write a command to convert a string into an int in python.
Is self a keyword in python?
Write a program to create a class and make an object of the class in python?
What is a static method in python?
Is python useful for finance?