Category "loops"

Issue with looping through elements in an inner array

I'm having an issue looping through a set of css classes when an iteration of an outer loop is being executed. What I'm trying to do is to append all the paragr

How to implement Iteration over the Nested Nullable Lists using Java 8

How can implement iteration done with multiple loops using Java 8 ? I need to check if one of the nested objects contains the specified String i.e. "BA" or not?

Looping through a 3-D Array

I initially asked this question How to loop through a specific row of a 2-dimensional Array? and @FaneDuru was kind enough to supply a solution but now I am hop

How it's logically possible to exit this loop while gathering data

here's the API for refence: https://github.com/JeremySkalla/pysmashgg/tree/3b04a4b2d83bbfe765c519ac37c437f478984742 There is a function in the API event_by_game

Begin loop with end of previous loop (Excel vba - For Loop)

I have following code Sub Example() Dim l1 As Integer Dim l2 As Integer Dim l3 As Integer For l3 = 1 To 2 For l1 = 1 To 2

Iterating through integers not found in a list of ranges in Python

So, I have a function which outputs a list of ranges, e.g. [range(1,5),range(8,13)]. I need to iterate through those integers which are not in a range in this l

Counting how many times value meets 2 times in a row in list

I need to count how many times 'Eagle' appears 2 times in a row in random generated list. In case ['Eagle', 'Eagle', 'Eagle', 'Eagle'] it should count 2, not 3

Calling function from for loop - issue with parameters: NameError: name 'row' is not defined

I am calculating commute distances (home to offices) for all employees. This works for a single office with this piece of code: #Calculate distances from home t

how can I loop through search function - python

I am trying to make search program but I stuck in some loop part. There are several steps for function works. First, I will get a word(input) from users. Then,

Print out a list of prime numbers in python

The question is: print out all numbers from 1 to 1000 that satisfy the two conditions: Those are prime numbers The numbers after being reversed are also prime n

How to make python read multiple sheets on an excel file one by one

Stackoverflow Hi python noob here. I been learning python for couple of weeks so I don’t know if this is possible or even super easy. I have an excel file

Strange result when removing item from a list while iterating over it [duplicate]

I've got this piece of code: numbers = range(1, 50) for i in numbers: if i < 20: numbers.remove(i) print(numbers) but the re

How to break for loop at the end of a line

Task at hand here is to create a dictionary using specified inputs. First element is key and following elements are values. Input: name, George Mason pa, 100.0,

python random_sample to generate values

I am currently using random_sample to generate weightage allocation for 3 stocks where each row values add up to 1 and I rounded them to 2dp. weightage=[] n = 0

I need help understanding a Javascript function used to search a list with a search bar so I can modify it to search a table

I'm working on a college assignment where I use a PHP class to generate table values which a Javascript function then searches with a search bar. It builds off

how do you convert a list into a int in python in one/two lines?

If you want to convert a list into a int You could use x = "" the_list = [5,7,8,6] for integer in the_list: x+=str(integer) ans = int(x) #output 5786 is

"Declare" loop creates output for only one of the variables

I have written a script to create a loop for a software I'm running: #!/bin/bash declare -a pops=("pop1" "pop2" "pop3") for target in "${pops[@]}"; do while I

Itering and compare struct element with different size

I've a tricky question and I don't know if there is any solution. Basically I've populated a struct using x-macros, for example with the following macro: #defin

How to replicate a function for a nested list

I have a nested list (datalist) which I'd like to repeat the following function for. Within datalist are multiple dataframes (e.g., A-F). After doing the follow

Itering and compare struct element with different size

I've a tricky question and I don't know if there is any solution. Basically I've populated a struct using x-macros, for example with the following macro: #defin