Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
Recent questions tagged list
0
votes
Q: How can I remove an element from a list?
I have a list and I want to remove a single element from it. How can I do this? I've tried looking ... 't found anything appropriate. Select the correct answer from above options...
asked
Feb 8, 2022
in
Education
by
JackTerrance
rprogramming
list
0
votes
Q: How can I reverse a list in Python?
How can I do the following in Python? array = [0, 10, 20, 40] for (i = array.length() - 1; i >= ... but from the end to the beginning. Select the correct answer from above options...
asked
Feb 4, 2022
in
Education
by
JackTerrance
python
list
0
votes
Q: python write list to file
Is this the cleanest way to write a list to a file, since writelines() doesn't insert newline characters? file. ... be a standard way. Select the correct answer from above options...
asked
Feb 4, 2022
in
Education
by
JackTerrance
python
list
file-io
0
votes
Q: How to return dictionary keys as a list in Python?
In Python 2.7, I could get dictionary keys, values, or items as a list: >>> newdict = {1:0, 2:0, 3:0} ... to return a list in Python 3? Select the correct answer from above options...
asked
Feb 4, 2022
in
Education
by
JackTerrance
python
list
dictionary
0
votes
Q: Convert two lists into a dictionary
Imagine that you have: keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam'] What is the simplest way ... 42, 'food' : 'spam'} Select the correct answer from above options...
asked
Jan 30, 2022
in
Education
by
JackTerrance
python
list
0
votes
Q: Shuffling a list of objects
I have a list of objects in Python and I want to shuffle them. I thought I could use the random.shuffle method, ... (b) This will fail. Select the correct answer from above options...
asked
Jan 27, 2022
in
Education
by
JackTerrance
python
random
list
loop
0
votes
Q: How do you remove duplicates from a list whilst preserving order?
Is there a built-in that removes duplicates from a list in Python, whilst preserving order? I know that I can ... idiom if possible. Select the correct answer from above options...
asked
Jan 26, 2022
in
Education
by
JackTerrance
python
list
duplicate
python-faq
python-programming
0
votes
Q: Partial match between two python lists, one list exactly present in the other with few additional characters in Python
I want to create a new list from the existing two lists that will have all the matches from list 2 which has an exact ... *", i) in a] Select the correct answer from above options...
asked
Jan 25, 2022
in
Education
by
JackTerrance
python
list
dictionary
list-comprehension
0
votes
Q: How do I get the number of elements in a list in Python?
How can I get the number of elements of a list? Ex- items = [] items.append("one") items.append("two") items.append("three") Select the correct answer from above options...
asked
Jan 24, 2022
in
Education
by
JackTerrance
python
python-faq
list
0
votes
Q: How do I check if a list is empty?
suppose I have passed : list=[] How can I check if a list is empty or not? Select the correct answer from above options...
asked
Jan 24, 2022
in
Education
by
JackTerrance
list
python
python-faq
Page:
1
2
next »
...