251 questions
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...
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...
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...
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(...
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,...
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...
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', ...
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...
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...
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...
« | - 23 - | » |
ยฉ 2024 OneMinuteCode. All rights reserved.