Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the function of negative index?

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


Please Help Members By Posting Answers For Below Questions

What is a file in python?

895


What is flask-wtf and what are their features?

845


Can you write an efficient code to count the number of capital letters in a file?

832


Is there a double type in python?

810


What is python's slice notation?

963


Explain about the programming language python?

843


How to sort a dictionary by key in python?

829


How do you sort a list in ascending order in python?

847


Why is __ init __ used in python?

877


How many kinds of sequences are supported by python? What are they?

977


What is tuple?

881


What is pytest?

861


What is yaml file in python?

873


Tell me what's the process to get the home directory using ‘~' in python?

887


What do you understand by deque in python?

898