PY4E - Python Lists (Chapter 8 Part 1)

www.py4e.com - Python for Everybody: Exploring Data
Please visit the web site to access a free textbook, free supporting materials, as well as interactive exercises. You can see my entire online curriculum at online.dr-chuck.com

Пікірлер: 3

  • @ingenuity8886
    @ingenuity88864 ай бұрын

    I used the range function and run print(range(4)) but the output was range(0,4) and not [0,1,2,3]. Any reason why?!

  • @chrisw1462

    @chrisw1462

    4 ай бұрын

    Yes.. Python has changed. It used to return the list as in the video. As of 3.3 (IIRC) it returns something called an iterator. Iterators are a very important topic in Python, and this video really needs to be updated. I suspect the reason it hasn't is that iterators would require their own chapter. It isn't a big deal - everything acts the same except for printing one out. Find a good video on Python Iterators to catch up - but be prepared - it's deep.

  • @RayT314

    @RayT314

    3 ай бұрын

    @@chrisw1462Thanks, actually just commented in the PY4E forms about this question. Helpful answer!!