thewhitetulip / build-app-with-python-antitextbook

Aims to teach Python3 by example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use enumerate instead of awkward range(len)

thewhitetulip opened this issue · comments

import sys
for i, item in enumerate(sys.argv):
    print("{} {}".format(i, item))

https://www.reddit.com/r/learnpython/comments/608fm3/thank_you_rlearnpython_just_finished_the_final/df4tjl3/