- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python program to compute the power by Index element in List
When it is required to compute the power by index element in a list, the simple iteration along with the ‘**’ operator is used.
Below is a demonstration of the same
my_list = [62, 18, 12, 63, 44, 75] print("The list is :") print(my_list) my_result =  for my_index, elem in enumerate(my_list): my_result.append(elem ** my_index) print("The result is :") print(my_result)
The list is : [62, 18, 12, 63, 44, 75] The result is : [1, 18, 144, 250047, 3748096, 2373046875]
A list is defined and is displayed on the console.
An empty list is defined.
The list is iterated over and the element raised to the power of the index is appended to the empty list.
This is displayed as output on the console.
- How to remove an element from a list by index in Python?
- Python – Negative index of Element in List
- C# program to find the index of an element in a List
- Program to get maximum value of power of a list by rearranging elements in Python
- Program to find index, where we can insert element to keep list sorted in Python
- Compute modulus division by a power-of-2-number in C#
- Program to Find Out the Maximum Final Power of a List in Python
- Python program to covert tuple into list by adding the given string after every element
- Python program to convert tuple into list by adding the given string after every element
- Program to reverse a list by list slicing in Python
- Python Pandas - Compute indexer and mask for new index given the current index
- How can I remove the same element in the list by Python
- Python Program to find the cube of each list element
- How to find what is the index of an element in a list in Python?
- Filter Tuples by Kth element from List in Python