Python Forum
How to manipulate between lists and get results
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to manipulate between lists and get results
#11
This is awesome, but how do we really know that we should use indexing, is there an ordered way of studying python? i am just learning through internet and forums

(Mar-07-2018, 05:27 PM)nilamo Wrote:
>>> spams = [2, 4, 2, 5]
>>> eggs = [6, 4, 3, 2]
>>> for index in range(len(spams)):
...   left = spams[index]
...   right = eggs[index]
...   print("Index: {0}  Items: {1}|{2}".format(index, left, right))
...
Index: 0  Items: 2|6
Index: 1  Items: 4|4
Index: 2  Items: 2|3
Index: 3  Items: 5|2

Here , how can i multiply the Index 2 items 2 with index 1 item 4
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using an integer to manipulate a string/text variable rexyboy2121 1 1,762 Apr-22-2020, 01:37 AM
Last Post: michael1789

Forum Jump:

User Panel Messages

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