Is iteration of all the datatype is possible ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is iteration of all the datatype is possible ?

1st Oct 2020, 8:15 AM
Crypto Genesis
Crypto Genesis - avatar
2 Answers
+ 4
Datatypes, structures and objects that can be iterated are: string, list, tuple, set, dict, range, file, ...
1st Oct 2020, 12:04 PM
Lothar
Lothar - avatar
+ 1
No. Only the types that have an __iter__ method in them.
1st Oct 2020, 8:39 AM
XXX
XXX - avatar