list tag

251 questions


4 answers
76 views
0
Python's 2D list. I have a question.

Hello, I'm going to create a function that takes the mean from the list in the list. grades = [ ['Student', 'Quiz 1', 'Quiz 2', 'Quiz 3'], ['Joe', 100, 90, 80], ['McD', 88, 99, 111], ['Ruta', ...

2 years ago

1 answers
45 views
0
Automatically generate Python lists

How can I make a code that makes a list of n when I get the number n from the user?I was going to write a for statement, but it's hard...

2 years ago

1 answers
144 views
0
Python List Function Question

1.def random_pop(data): number = random.randint(0, len(data)-1) return data.pop(number)2.def random_pop(data): number = random.choice(data) data.remove(number) return numberThese two functions return ...

2 years ago

1 answers
45 views
0
How to compare lists

[List 1]abcde[List 2]efgabIf there are two lists, compare List 1 with List 2 in totalReturn 1 because element a is in list 2, and return 1 because element b is in list 2,Since c, d, and e are not in l...

2 years ago

1 answers
96 views
0
I want to know how to sort the list in descending order without using the built-in function of the list.

import randoma = random.sample(range(1,100,10) #using the random module sample, random.sample(range, end value, sampling count)smallest = a[0]for i in a: if i < smallest: smallest = iA = smallestpr...

2 years ago

1 answers
130 views
0
I'd like to find the matching values in List 1 and List 2. - Python

I'm a beginner at Python.I couldn't find what I wanted even if I searched it.I ask for your help me.List1 = [{'id':1}, {'id':2}, {'id':3 }, {'id':4}]List2 = [{'id':1}, {'id':4}]If you compare the valu...

2 years ago

1 answers
84 views
0
How to replace ArrayList with String[] array

String [] stockArr = {hello, world};This worksString [] stockArr = (String[]) stock_list.toArray();Why isn't this working?How do I change ArrayList to String[]?

2 years ago

2 answers
55 views
0
Please find the Python error.

It is a code that consists of English words in the list, and then receives the word you want to find, outputs the index number from the list if there is the same thing, and outputs -1 if not.For examp...

2 years ago

1 answers
87 views
0
Randomize lists

For example, what should I do if I want to show off 100 random things out of a thousand lists...?

2 years ago

1 answers
150 views
0
Can I put two Python lists in the dictionary's key and value values?

Can I put two lists in one dictionary as keys and values?a=[Apple, Banana, Pineapple]b=[1,2,3]When dic={'Apple':1, 'Banana':2, 'Pineapple':3}Can you put it in order like this?

« - 8 - »

© 2024 OneMinuteCode. All rights reserved.