Skip to content

Files

Latest commit

 

History

History
24 lines (16 loc) · 508 Bytes

not-an-iterable.md

File metadata and controls

24 lines (16 loc) · 508 Bytes

Pattern: Iterable is expected but not used

Issue: -

Description

When a non-iterable value is used in place where iterable is expected, a runtime error is raised. Remove it's use or update code to return an iterable.

Example of incorrect code:

for i in 8.5:
    print i

Example of correct code:

for i in range(1, 10):
    print i

Further Reading