list tag

251 questions


1 answers
40 views
0
Apply to factors as Python list

I want to turn over the two-dimensional list as a factor for the Python zip function, what should I do?Like the JavaScript application method.def myFunc(a1, a2, a3): do_something(...)myFunc.some_metho...

2 years ago

1 answers
71 views
0
Check for non-overlapping values with Python tea sets.

Hi, everyone.I am a beginner among beginners who have only started studying Python by myself for about a month.I was making a program because I thought of oneEnter the values in the first and second t...

2 years ago

1 answers
137 views
0
Is it impossible to take out the tuples on the list?

import itertoolsimport randomn = [1,2,3]a=list(itertools.combinations(n,2))b=list(random.choice(a))c =[]for x in a: if x not in b: c.append(x)print(a)print(b)print(c)I want to put the value of element...

2 years ago

1 answers
68 views
0
Scalar list merge question

I'd like to merge the list with or condition.For example, List(List(1), List(2))List(List(1), List(2), List(3))List(List(2), List(3))List(List(4))Merge the above four lists to result values List(List(...

2 years ago

1 answers
126 views
0
Python novice list - remove I have a question Peep ๐Ÿฅ๐Ÿค๐Ÿฃ

When you want to remove a common number in the lista = [1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7]for remove_one in a: a.remove(1)print(a)[2, 3, 4, 5, 6, 7]All 1s are removed herea = [1, 2, 1, 1, 1, 1, 1, 1,...

2 years ago

2 answers
42 views
0
When only Python a.pop() is executed, the result value is printed, but in the repetitive statement code, the output value is only printed.

a = [1, 2, 3, 4]while a: a.pop()Why doesn't the result come out when you run the code above?If you just run a.pop(), the result value is printed, but the code above shows the output value only when yo...

2 years ago

1 answers
45 views
0
Deduplication of Python List!

Task: Modify the code so that 8 groups of the group draw program are drawn at once without duplication!import randomimport tkinter# Group draw functiondef lotto(): teams = [ {'Group 1': [Kim Il-il', ...

2 years ago

1 answers
65 views
0
When randomizing a Python list, randomize it by the number of random numbers n (please look at the code...)

I'm still an inexperienced student in coding.An error occurs when you try to randomly extract (redundant) n (1<=n<=18) from the list... In this case, I'd like you to tell me how to code.import r...

2 years ago

1 answers
43 views
0
I'm asking you a question after revising it again. Extract specific files from list

Hi, how are you?For example, the file name has the following specific patterns:3G1-1EW_E-W_ACC3G1-1NS_N-S_ACC3G1-1UD_U-D_ACC3G1-2EW_E-W_ACC3G1-2NS_N-S_ACC3G1-2UD_U-D_ACCWhen referred to as abc-def_g-h...

2 years ago

2 answers
45 views
0
[Python] The coding to find the minimum and maximum values of the elements in the list does not work normally

It's a problem that implements functions without sum, max, and min! import random def randStat(n): rand_list=random.sample(range(0,100),n) # 0 : sum sum like variable declaration For val in range...

2 years ago
« - 23 - »

ยฉ 2024 OneMinuteCode. All rights reserved.