Skip to content

almadhlom/python-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 

Repository files navigation

python-automation

โœ… Python Tip: Use enumerate() for index and value in loops

The enumerate() function is used when you want both the index and the value while looping through a list.

๐Ÿ”น Example:

fruits = ["apple", "banana", "cherry"]

for index, value in enumerate(fruits):
    print(index, value)

๐Ÿ”น Output:

0 apple
1 banana
2 cherry

โœ… Why use enumerate()?

  • It makes code clean and readable
  • You don't need to manually manage a counter
  • Very useful in automation and data processing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages