May-07-2022, 06:24 AM
how do you recall a item from a list
|
recall
|
|
May-07-2022, 06:24 AM
how do you recall a item from a list
May-07-2022, 08:04 AM
Not really sure what your asking for but, here are some examples of getting list elements
mylist = ['one', 'two', 3, 4, 'five', 'six']
print(mylist)
# Print all list values:
for item in mylist:
print(item)
# print list item by index
# list index starts at 0
print(f'first item -> {mylist[0]}, item 4 -> {mylist[3]}')
# List and index number
for i, item in enumerate(mylist):
print(f'index: {i} list item: {item}')
I welcome all feedback.
The only dumb question, is one that doesn't get asked. My Github How to post code using bbtags Download my project scripts |
|
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| trying to recall a regex for re.split() | Skaperen | 23 | 10,127 |
May-20-2022, 11:38 AM Last Post: snippsat |
|