Help! zip() function - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Help! zip() function (/thread-26946.html) |
Help! zip() function - bwdu - May-19-2020 Hello everyone! I couldn't understand why it didn't write y. How can i fix this ---> <zip object at 0x0139F608> ? Here is my code: rbooks = [] nratings = [] books = list(a) for i in range(13): c = random.choice(books) print(c) rbooks.append(c) m = input("rate: ") nratings.append(m) print(rbooks) print(nratings) y = zip(rbooks,nratings) print(y)
RE: Help! zip() function - ndc85430 - May-19-2020 See the discussion in this thread - it's the same thing. RE: Help! zip() function - Larz60+ - May-19-2020 replace line 17 with for item in y: ... print(item)Also, using one letter names is taboo, you should make it a habit to use meaningful names, even with throwaway scripts. |