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
How python does compile-time and run-time code checking?
What will be the output of ['!!welcome!!']*2?
What is instance of a class?
What is python keyword?
What are all important modules in python reuired for a data science ?
How is Python used in web development?
Is python a pop or oop?
Does netflix use python?
Is python dictionary a hash table?
What is python inheritance?
What are the modes to open a file in python?
How would you work with numbers other than those in the decimal number system?
What is scheduling in threading?
How is fail over mechanism works in python?
What is the difference between python append () and extend () functions?