Discussions Populaires Dans la Communauté Apprentissage automatique

S'abonner

Questionnez la Communauté


Ask any professional question and get answers from other specialists.

Stream language
jahangir khan's image  
La répondre a été ajoutée par  jahangir khan, I.T Support Assistant, Pakistan Air Force
Depuis 22 heures

my_list = [10, 20, 30, 40, 50] print(my_list[-1]) # Accessing the last element: 50print(my_list[-2]) # Accessing the second-to-last element: 40print(my_list[-3]) # Acces ... Voir Plus

Signaler CV
Mohanesh Barge's image  
La répondre a été ajoutée par  Mohanesh Barge, Service engineer, A Square Technosolution, Pune
Depuis 1 jour

a negative index is a way to extract elements in a list, tuple, or string by counting from the end of the sequence instead of the beginning

Signaler CV
Minal Prindawankar's image  
La répondre a été ajoutée par  Minal Prindawankar
Depuis 1 jour

Negative indexing in Python is a way to access elements of a list, tuple, or string from the end of the data structure instead of the beginning. 

Signaler CV
Imtiyaz Bhat's image  
La répondre a été ajoutée par  Imtiyaz Bhat
Depuis 2 jours

It is meant for the purpose of Slicing in the python 3.0 at the end of the string.

Signaler CV
Nancy Nainan's image  
La répondre a été ajoutée par  Nancy Nainan, Technical Specialist, Nokia
Depuis 3 jours

Negative Index to reverse the list or access the list in reverse way. fruit = ['a','p','p','l','e'] print(fruit[-1]) --& ... Voir Plus

Signaler CV
Poti Jyothi's image  
La répondre a été ajoutée par  Poti Jyothi
Depuis 4 jours

Negative indexing is each traversal moves from tail to head, starting with the last element.

Signaler CV
Nehmetallah Ghanem's image  
La répondre a été ajoutée par  Nehmetallah Ghanem
Depuis 5 jours

Negative Index in python starts counting from the end of the data structure rather than the beginning

Signaler CV
Aly  Mtsumi's image  
La répondre a été ajoutée par  Aly Mtsumi, Full Stack Sofware Developer, Revolution Analytics
Depuis 5 jours

In python the negative index is used to start slicing from the end of the list, -1 would be the last element in the list.

Signaler CV
Reyad Al-Noubeh's image  
La répondre a été ajoutée par  Reyad Al-Noubeh, IT Department Executive Director, Talal Abu Ghazaleh International Group
Depuis 10 jours

Negative indexing in Python provides a convenient way to access elements from the end of a sequence, such as lists, tuples, or strings. When using negative indices, Pytho ... Voir Plus

Signaler CV
Raza  Ullah's image  
La répondre a été ajoutée par  Raza Ullah, Associate Python Developer, International Medical Corps
Depuis 12 jours

In Python negative refers to accessing elements from the end of a sequence such as a list or string. For example my_list = [1,22,32,54,67] my_list[-1] will give 67.my_lis ... Voir Plus

Signaler CV