Reverse indexing in Python | Example code

Reversing indexing of list in reverse the List in Python. It could do easily done by using Slice Notation in python. Example reverse indexing in Python Simple example code, Reverse a list. Another solution using reversed instead of slicing with [::-1]: Output: Reverse string using Reverse indexing in Python Output: nohtyP Do comment if you Read More…


Find the index of duplicate elements in list Python | Example code

Using enumerate with for-loop and if statement you can get the index of duplicate elements in python list. Find an index of duplicate elements in list Python Example Simple example code. Output: Another examples using collections You have to import collections module for this example. Output: index of 1 = 0index of 2 = 1index Read More…


Remove element from list Python by index | Example code

Use pop() method or del keyword to remove an element from list python by index. The pop() is useful to remove and keep an item from a list. Where del actually trashes the item. Example remove an element from a list by index in Python Simple example code. Using pop() function If you want to Read More…



Write a Python program to print the index of the character in a string

Use the for-loop and enumerate function to print the index of the character in a string. Python program to print the index of the character in a string Example Simple example code. Output: Do comment if you have any doubts and suggestions on this python index char topic RohitDegree in Computer Science and Engineer: App Read More…


Python find all indexes of character in a string | Example code

You don’t need to use a special method to find all indexes of characters in a string in Python. Just use for-loop and if statement logic to get done this task. Python find all indexes of character in a string Example Simple example code finds all occurrence index of “s” char in a given string. Read More…