Electron microscopy
 
enumerate()
- Python Automation and Machine Learning for ICs -
- An Online Book -
Python Automation and Machine Learning for ICs                                                   http://www.globalsino.com/ICs/        


Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

=================================================================================

The enumerate() function in Python is a built-in function that is used specifically for iterating over a sequence (such as a list, tuple, or string) while keeping track of the index (position) of the current element. It returns pairs of index and element, making it easier to loop through elements and their corresponding positions in an iterable.

For instance,  a Python code is:  

my_list = ['apple', 'banana', 'orange'] 

for index, value in enumerate(my_list): print(f"Index: {index}, Value: {value}")

Then, the output will be:

 Index: 0, Value: apple 

Index: 1, Value: banana 

Index: 2, Value: orange

============================================ 

Using enumerate() to get index and key-value pairs. Code:

 

Output:

============================================ 

Count if there is empty strings in a list. Code:
         Upload Files to Webpages
       Output:    
         Upload Files to Webpages

============================================

Find duplicate items in a list: Code:
              copy Xpath from a webpage
Output:
              copy Xpath from a webpage

============================================

Find duplicate items in a list: Code:
              copy Xpath from a webpage
Output:
              copy Xpath from a webpage

============================================

Add inputs: code:
         Plot histogram in numpy
Output 1:         
         Plot histogram in numpy
         Plot histogram in numpy
         Plot histogram in numpy         
Output 2 (with a code line of "print(int(ent1.get())+int(ent2.get()))"):                   
         Plot histogram in numpy
         Plot histogram in numpy         

============================================

Single options: code:          
          Launch the existing opened application if there is or start a new one if there is not
Output 1:          
         Launch the existing opened application if there is or start a new one if there is not         
Output 2:          
         Launch the existing opened application if there is or start a new one if there is not
         Launch the existing opened application if there is or start a new one if there is not         
Output 3:          
         Launch the existing opened application if there is or start a new one if there is not
         Launch the existing opened application if there is or start a new one if there is not         
Output 4:          
         Launch the existing opened application if there is or start a new one if there is not
         Launch the existing opened application if there is or start a new one if there is not

============================================

Open a file with file index in the folder: code:          
          Launch the existing opened application if there is or start a new one if there is not
Output (then enter any number to open the specific file):          
         Launch the existing opened application if there is or start a new one if there is not
         Launch the existing opened application if there is or start a new one if there is not

============================================

Remove the item which has duplicates without removing the first one: code:          
          Remove an item/element from a list
Output:         
          Remove an item/element from a list

============================================

Extract elements from a list using index. Code:
         Upload Files to Webpages
       Output:    
         Upload Files to Webpages

============================================

         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 

 

 

 

 

 

=================================================================================