ubsuny / CP1-24-HW3

Homework 3 template for CP1-24
1 stars 16 forks source link

A question about iterators. #50

Closed HeshamElsaman closed 1 week ago

HeshamElsaman commented 1 week ago

Is there a fundamental difference between iterators in Python and the concept of pointers in C/C++ ?

avgagliardo commented 1 week ago

With respect to datatypes, they are very different. C++ requires you to be very explicit with your data types while using iterators, in python they just work.

It takes a little bit of getting used to, because it seems like you are working with less information but the iterator objects are actually very "smart" and their uses generally conform to the same set of patterns.

Here are some docs on python iterators.

HeshamElsaman commented 1 week ago

Thanks, a lot!