
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
62 Views
When it is required to redistribute the trimmed values, a list comprehension and the ‘/’ operator are used.ExampleBelow is a demonstration of the samemy_list = [11, 26, 24, 75, 96, 37, 48, 29, 93] print("The list is :") print(my_list) key = 2 print("The value of key is") print(key) ... Read More

AmitDiwan
1K+ Views
When it is required to get the count of consecutive identical elements in a list, an iteration, the ‘append’ method, and the ‘set’ method are used.ExampleBelow is a demonstration of the samemy_list = [24, 24, 24, 15, 15, 64, 64, 71, 13, 95, 100] print("The list is :") print(my_list) ... Read More

AmitDiwan
759 Views
When it is required to give the rows with all list elements, a flag value, a simple iteration and the ‘append’ method is used.ExampleBelow is a demonstration of the samemy_list = [[8, 6, 3, 2], [1, 6], [2, 1, 7], [8, 1, 2]] print("The list is :") print(my_list) ... Read More

AmitDiwan
206 Views
When it is required to filter rows without the soace strings, a list comprehension, regular expression, the ‘not’ operator and the ‘any’ method are used.ExampleBelow is a demonstration of the sameimport re my_list = [["python is", "fun"], ["python", "good"], ["python is cool"], ["love", "python"]] print("The list is :") ... Read More

AmitDiwan
233 Views
When it is required to find equidistant consecutive character strings, a list comprehension, the ‘all’ operator and the ‘ord’ method are used.ExampleBelow is a demonstration of the samemy_list = ["abc", "egfg", "mpsv", "abed", 'xzbd', 'agms'] print("The list is :") print(my_list) my_result = [sub for sub in my_list if ... Read More

AmitDiwan
159 Views
When it is required to reform K digit elements, a list comprehension and the ‘append’ method are used.ExampleBelow is a demonstration of the samemy_list = [231, 67, 232, 1, 238, 31, 793] print("The list is :") print(my_list) K = 3 print("The value of K is ") print(K) ... Read More

AmitDiwan
265 Views
When it is required to check if all ‘y’ occurs after ‘x’ in a list, the enumerate attribute along with a specific condition is used.ExampleBelow is a demonstration of the samemy_list = [11, 25, 13, 11, 64, 25, 8, 9] print("The list is :") print(my_list) x, y = ... Read More

AmitDiwan
223 Views
When it is required to test if all rows contain any common element with other matrix, a simple iteration and a flag value are used.ExampleBelow is a demonstration of the samemy_list_1 = [[3, 16, 1], [2, 4], [4, 31, 31]] my_list_2 = [[42, 16, 12], [42, 8, 12], [31, 7, ... Read More

AmitDiwan
148 Views
When it is required to reorder consecutive elements, the ‘Counter’ method, an empty list and a simple iteration are used.ExampleBelow is a demonstration of the samefrom collections import Counter my_list = [21, 83, 44, 52, 61, 72, 81, 96, 18, 44] print("The list is :") print(my_list) my_frequencys ... Read More

AmitDiwan
113 Views
When it is required to remove every ‘y’ occurrence before ‘x’ in a list, a list comprehension along with the ‘index’ method are used.ExampleBelow is a demonstration of the samemy_list = [4, 45, 75, 46, 66, 77, 48, 99, 10, 40, 5, 8] print("The list is :") print(my_list) ... Read More