[Solved] Seperating the numbers from strings to do the maths and return the string with the results [closed]

There are a few different components to this problem. First, how do you split the receipt into each individual company. Next you need to be able to parse the company’s ID. Finally you need to be able to parse the quantity, cost, and total cost from a line item. Splitting Receipts Your method of splitting … Read more

[Solved] Get single item from List

You should read the documentation of List and Map (respective HashMap) to see how to use them. Since your List contains Map you’ll have to get a Map using the List operations and then get the elements from that Map using the Map operations: HashMap<String, String> firstMap = lst.get(0); String someEntry = firstMap.get(“key”); 0 solved … Read more

[Solved] verify continuous segments in list [closed]

What about creating a small function that turns the lists into strings and runs a regex against it, You could tidy this up, or I could if you approve this concept I’m not a regex, expert I’m sure there is another way to do this without using the AttribeError but this will work, someone can … Read more

[Solved] how do I count unique words of text files in specific directory with Python? [closed]

textfile=open(‘somefile.txt’,’r’) text_list=[line.split(‘ ‘) for line in textfile] unique_words=[word for word in text_list if word not in unique_words] print(len(unique_words)) That’s the general gist of it solved how do I count unique words of text files in specific directory with Python? [closed]

[Solved] How to remove part of a data string? [closed]

It’s unclear what ResultSet is and its format from your question, however the following example code might be helpful: import csv csv_filename=”result_set.csv” ResultSet = {“(u’maxbotix_depth’, None)”: [{u’time’: u’2017-07-12T12:15:54.107488923Z’, u’value’: 7681}, {u’time’: u’2017-07-12T12:26:01.295268409Z’, u’value’: 7672}]} with open(csv_filename, mode=”wb”) as csv_file: writer = csv.writer(csv_file) for obj in ResultSet[“(u’maxbotix_depth’, None)”]: time, value = obj[u’time’], obj[u’value’] print(‘time: {}, value: … Read more

[Solved] Some problem about the algorithm of merging two lists

The line vector<int> list3(list1.size()+list2.size()); creates a vector of type int and inserts list1.size()+list2.size() default contructed elements. You want to create an empty vector of type int and reserve memory for list1.size()+list2.size() elements. Use vector<int> list3; list3.reserve(list1.size()+list2.size()); solved Some problem about the algorithm of merging two lists

[Solved] C++ return a list of values? [closed]

In your code, you declare to return type T, but the variable you return has type list<T>. I’d suggest to develop your code with concrete types (and without templates) first; you can exchange the concrete type with placeholders afterwards, but concrete types give a better idea what actually happens. Try the following code and translate … Read more