Category "list"

Getting a map() to return a list in Python 3.x

I'm trying to map a list into hex, and then use the list elsewhere. In python 2.6, this was easy: A: Python 2.6: >>> map(chr, [66, 53, 0, 94]) ['B',

Add string and integer from one line string generate by speech recognizer to 2 separate list

I have some string from speech recognizer and the value is random but in the same form (x,y...n) MyOrder = 'orange 2 grape 3 apple 4 mango 5 banana 1' How to a

Collect data, but skip non-zero referenced-data

i have the following fnf([],[],[]). fnf([RH|RT],[CH|CT],[[RH,CH]|Res]) :- get(RH,CH,V), V == 0, fnf(RT,CT,Res). i'm trying to collect only elements of Cs and R

Can I increase the value of every item in the list by 1 in every 1 minute in Python?

I would like to do it by constantly checking local time in my computer. Is there also a way to do it by NOT checking with time of local machine? I want to also

I want to make an calculator for average but i'm facing some issues

I want to make an calculator for average but i'm facing some issues. I want the numbers entered by the users come as a print statement but it is just throwing t

Return sub list of elements based on matching sub strings from another list

I want to filter a list of string based on another list of sub strings. main_list=['London','England','Japan','China','Netherland'] sub_list=['don','land'] I w

list_remove_unrelated_type - dart

I have a function like this: void function(List<int> listToRemove) { final List<int> list = [1, 2, 3, 4, 5]; list.remove(listToRemove); } and i

When I convert the obtained road network data into a geodataframes structure, why does the list element appear in the highway column?

import osmnx as ox G = ox.graph_from_place('成都市',network_type='all') G = ox.project_graph(G) ox.plot_graph(G) # 将图形

Delete an element at a specified index, return untouched list if given negative or 0 as an index

Hi I really am needing help with this Prolog problem. I want to delete an element at a specified index but only when given an index that is greater than 0. If t

Remove key from map kotlin

I have a map as follows val parentMap= mutableMapOf<String,String>() parentMap["key1"]="value1" parentMap["key2"]="value2" parentMap["key3"]

How can I limit the number of webelements in a list using Selenium and Java

I have this number of list from the following dom, There are total 10 elements. I want to store the first 5 elements from the list in a variable. How can i do i

lines repeat in List python

I need your help with the next problem, i need that a python recieve an string "EEEEDDSGES" and the output would by the sum of charactes that repeat in line, E

Sum of list values in a df, new column, values are objects

I have a df made of values from a dictionary. I can get rid of [], ',' and split it all in different cols (one col per number). But can't make the transfer to f

how python [0] * 3 are independent but [[0] * 3] * 3 each sub list is the same object? [duplicate]

my_list = [0] * 3 my_list[0] = 1 outputs to [1, 0, 0] my_2ndlist = [[0] * 3] * 3 my_2ndlist[1][1] = 5 outputs to [[0, 5, 0], [0, 5, 0], [0,

Is there a simple way to compare two class objects for all items that are not none?

I am looking to compare two instances of the same class, but only the items for which both are not None. for instance, I will have a Bolt class, and one instanc

list values into entry widgets

I am trying to put list values into entry widgets, keep getting brackets and quotes. lista = ['abc', 'def', 'ghi'] # These are normally strings, but can be inte

How to delete certain number from a list in list using the index in python?

I have a list in a list, and I am trying to delete the third number of each sublist, but every time I am getting an error TypeError: list indices must be intege

How to delete certain number from a list in list using the index in python?

I have a list in a list, and I am trying to delete the third number of each sublist, but every time I am getting an error TypeError: list indices must be intege

Can't get looping through regex list to work

import re othello_full = open('C:/Users/.../Othello.txt', encoding="mbcs").read() split_dialogue = othello_full.split("\n\n") dict = {} for i in split_dialo

Merge column into one string from 2D list

I want to merge one column into one string from 2D list. Are there better ways to merge it? lists = [['H', 'W'], ['e', 'o'], ['l', 'r'], ['l', 'l'], ['o','d']]