fork download
  1. lessons = ["Why Python Programming", "Data Types and Operators", "Control Flow", "Functions", "Scripting"]
  2.  
  3.  
  4. def my_enumerate(iterable, start=0):
  5. current = start
  6. for elem in iterable:
  7. yield current, elem
  8. current += 1
  9.  
  10.  
  11. for i, lesson in my_enumerate(lessons, 1):
  12. print("Lesson {}: {}".format(i, lesson))
Success #stdin #stdout 0.04s 9232KB
stdin
Standard input is empty
stdout
Lesson 1: Why Python Programming
Lesson 2: Data Types and Operators
Lesson 3: Control Flow
Lesson 4: Functions
Lesson 5: Scripting