Skip to main content

Questions tagged [list]

The list tag may refer to: a linked list (an ordered set of nodes, each referencing its successor), or a form of dynamic array. Not to be used for HTML lists, use [html-lists] instead.

0 votes
1 answer
15 views

How to make a flexible argument list for cursor.execute in python3?

In fact, I want to increase and decrease the mysql query items and the values ​​(arguments) according to the status of the variable values. based on my scenario I need to make a flexible mysql query ...
Alireza Mirhabibi - IRAN's user avatar
-2 votes
0 answers
11 views

how can I compute the striking force of a football player using python [closed]

in a football match between England and Spain Julius Fueke needs a decisive goal, write a Python program that can compute the striking force of each of the players i tried using the import numpy but ...
yagi's user avatar
  • 1
-1 votes
3 answers
66 views

How can I rewrite this block of if / Else if into a more structured, condensed and optimal way. (C#)

In C# .NET. This block of if/else if works fine, but its getting cumbersome to maintain and read. I want a more optimized writing style. if (Globals.SRSI < 10 && Globals.SRSI != 0 &&...
Harold's user avatar
  • 9
1 vote
4 answers
40 views

How to change the class of elements in a list?

I have a string for input with comma seperated elements. - marks = 'marks1,marks2,marks3' Using split function I got list of marks. - marks = marks.split(',') This gives us 'marks' a list with ...
Soham Gandhi's user avatar
-5 votes
3 answers
59 views

find if everything in a list between two indexes is equal to "empty" in python

I am working on a game in PyGame and I only want an enemy to move if all spaces between them and the player are "empty". the board is basically just a list: occupants = ["enemy", &...
Jasper Woertman's user avatar
1 vote
2 answers
36 views

Unpack values from column, which consist of list of dictionaries

I have dataframe, which looks like this: import pandas as pd df = pd.DataFrame({"item_id": [1, 2, 3], "item_properties":[ ...
Artem's user avatar
  • 11
0 votes
1 answer
26 views

need a way to update variable to include all input list items, formatted the same way

I'm running a program in python that sends graphql post requests. The query looks like this, : var = input("string here") query = f"""query{{item1(item2:"{var}"){{...
discord alt's user avatar
0 votes
2 answers
40 views

Different behavior when using const before a const constructor in Dart

In the Dart documentation, it states that we should not place const before initializing a const constructor, as the keyword is already implicit. However, can someone explain why the following codes ...
Lívia Carolina's user avatar
-3 votes
2 answers
58 views

How to skip first element of each row in csv file without changing csv file

I am using a for loop in python to convert the values from the csv file into integer and float then putting them in a list in the code itself but the problem is with that the csv file doesn't only ...
aaa bbb's user avatar
0 votes
0 answers
14 views

Exception caught by widgets library ═RangeError (index): Invalid value: Valid value range is empty: 0

i am having this error i tried to use list of cart from api getcartproducts to store in products list then to use in my widgets i don't know what is the issue! if some one can help me i am not expert ...
MOHAMED AMIIN ABDI AADAN's user avatar
-1 votes
3 answers
41 views

Why does this return an "out of range" error when working with a string-type list? [duplicate]

Below is the code below for a C# Console Application Hangman game. I would like to save the individual characters of the sentence the user has to guess in a list so that correctly guessed letters can ...
Alfred-B's user avatar
-4 votes
1 answer
31 views

how to extract files from a list using substring filter [duplicate]

I have a list of files from os.listdir like: TXSHP_20240712052921.csv TXSHP_20240715045301.csv TXSHP_FC_20210323084010.csv TXSHP_FC_20231116060918.csv how do I extract only the ones where 'FC' is ...
Ben Smith's user avatar
  • 362
-7 votes
0 answers
45 views

How this line works? (python) [closed]

def max_subarray_sum(nums: list) -> int: pass print(max_subarray_sum([-2,1,-3,4,-1,2,1,-5,4])) I want to know how the print line statement works in this program? I hope understanding this ...
Tamil Selvan's user avatar
1 vote
1 answer
63 views

Function checking if a given char* already exists in a list always returns true

My program is supposed to load data from a CSV file, where the last part of every line is the label of the given data point. Since the labels will repeat themselves, it's more efficient to simply ...
glacierDexeryl's user avatar
0 votes
1 answer
34 views

Send data to all sockets at exact time [closed]

Say we have array or list of sockets named (A,B,C) and we want to send data to all of them at the same exact time due to that the application is really time critical, then is there a away to send to ...
Akkad's user avatar
  • 641

15 30 50 per page
1
2 3 4 5
9455