Trending Machine Learning Discussions

Follow

Ask the Community


Ask any professional question and get answers from other specialists.

Stream language
jahangir khan's image  
Answer added by  jahangir khan, I.T Support Assistant, Pakistan Air Force
19 hours ago

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 ... See More

Mohanesh Barge's image  
Answer added by  Mohanesh Barge, Service engineer, A Square Technosolution, Pune
1 day ago

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

Minal Prindawankar's image  
Answer added by  Minal Prindawankar
1 day ago

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. 

Imtiyaz Bhat's image  
Answer added by  Imtiyaz Bhat
2 days ago

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

Nancy Nainan's image  
Answer added by  Nancy Nainan, Technical Specialist, Nokia
2 days ago

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

Poti Jyothi's image  
Answer added by  Poti Jyothi
4 days ago

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

Nehmetallah Ghanem's image  
Answer added by  Nehmetallah Ghanem
5 days ago

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

Aly  Mtsumi's image  
Answer added by  Aly Mtsumi, Full Stack Sofware Developer, Revolution Analytics
5 days ago

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.

Reyad Al-Noubeh's image  
Answer added by  Reyad Al-Noubeh, IT Department Executive Director, Talal Abu Ghazaleh International Group
10 days ago

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 ... See More

Raza  Ullah's image  
Answer added by  Raza Ullah, Associate Python Developer, International Medical Corps
12 days ago

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 ... See More