Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help! zip() function
#1
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)
Output:
['Elizabeth Laird,Kiss the Dust\n', 'Elizabeth Laird,Kiss the Dust\n', 'Guy Gavriel Kay,The Summer Tree\n', 'Dan Brown,The Da Vinci Code\n', 'H G Wells,The War Of The Worlds\n', 'Lurlene McDaniel,Breathless\n', 'Patricia C. Wrede,Dealing with Dragons\n', 'Suzanne Collins,The Hunger Games\n', 'C S Lewis,The Lion the Witch and the Wardrobe\n', 'Meg Cabot,The Princess Diaries\n', "Douglas Adams,The Hitchhiker's Guide To The Galaxy\n", 'Meg Cabot,The Princess Diaries\n', 'Maya Angelou,I Know Why the Caged Bird Sings\n'] ['5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5'] <zip object at 0x0139F608>
Reply


Messages In This Thread
Help! zip() function - by bwdu - May-19-2020, 03:03 PM
RE: Help! zip() function - by ndc85430 - May-19-2020, 03:16 PM
RE: Help! zip() function - by Larz60+ - May-19-2020, 07:12 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020