251 questions
I'm trying to cut strings one by one and put them on the list, but I keep getting errors. I'd appreciate it if you could tell me what the problem is.string = Hello World!list = []for i in string: lis...
If you try to find the same value among the two lists in Python, it is usually for i in list1: for j in list2: if i == j : print(i)I found it using the for statement twice, but I changed it to a set...
For example, ['level 10', 'level 4', 'level8', 'level9']level 10level 9level 8level 4I want to print it out like this, but if you just use a sort,level 9level 8level 4level 10This is what happens.Do y...
I want to input two lists and compare each list at the end and print out only the common item '0', what should I do? For example, when you enter it in the shell window,Enter cammate 1's Monday timetab...
I learned in Python that the map function is saved as a list.If so, I want to print out elements from the list created by the map function, but I get an error.Is there any other way I don't know?num, ...
If list1 has 5050 data from 1 to 5050, I'd like to convert it into a two-dimensional list.Put 1 in (0,0) and (1,0) = 2, (1,1) = 2, (2,0) = 4, (2,1) = 5
Is there any way to reduce the coding using the list function in the coding below?If it is not, or inefficient, could you tell me how to use another function?import RPi.Bringing up GPIO as GPIO #GPIO ...
list_1 = [(2, 0), (1, 1), (3, 2), (2, 3)]temp = list_1[0][0]if temp < max(list_1):I want to make sure that the values from the two-dimensional list are the highest values in this listSince it is a ...
N = 80z = np.zeros((N,2))for h in range(0,80,1): z[h,0] = h #constants mass_earth = 5.9722*10**(24) #[kg] radius_earth = 6371*10**(3) #[m] universal_gravitational_const = 6.674*10**(-11) #[m^3/kg^-1*s...
Hello, this is Corinne. I want to implement one, but it doesn't work.What I want to implement is So the final goal is to split an arbitrary list into the number you enter, and to bind an automatically...
« | - 20 - | » |
© 2024 OneMinuteCode. All rights reserved.