YuNing's Thought

Home

❯

Notes

❯

Python Functional Programming

Python Functional Programming

Jan 14, 20241 min read

enumerate(iter, start=0)

for item in enumerate(['subject', 'verb', 'object']):
...     print(item)
(0, 'subject')
(1, 'verb')
(2, 'object')
 
f = open('data.txt', 'r')
for i, line in enumerate(f):
    if line.strip() == '':
        print('Blank line at line #%i' % i)

functool

Links

  • Python Iterator
  • Python Generator
  • Python Lambda
  • Functional Programming
  • Functional Programming HOWTO — Python 3.12.1 documentation

Graph View

  • enumerate(iter, start=0)
  • functool
  • Links

Backlinks

  • Python Function
  • Python

Created with Quartz v4.5.2 © 2025

  • GitHub
  • Discord Community