It is give index and item so we can use index or item values in enumerate function I want to print odd value items ll = ["A","B","C","D"] for index, item in enumerate(ll): if index%2 == 0: print(item) output :A C
No comments:
Post a Comment