Questions tagged [loops]

Lô đề online Loops are a type of control flow structure in programming in which a series of statements may be executed repeatedly until some condition is met.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

recursively copying and renaming file works, then stopped unexpectedly

Context 1.Needed to copy and rename image file repeatedly until certain counting number reached. 2.The renaming part have to met certain increasing step. 3.It's Python 3.7.0 Code import os import ...
-1
votes
1answer
23 views

Error From Sorting String Variables Using Arrays.sort() In Java [duplicate]

When I try to sort out the names of the students, I get an error that I am unable to resolve. Could you please take a look at it? I want to sort out the names of the students in alphabetical order ...
0
votes
1answer
41 views

Creating a for loop that adds / removes its conditions based on a variable inside

Context for this problem i am rendering a html table that is in short a price ladder. I only want to render 100 prices up and down from this centre price. So far i have achieved this but the ladder of ...
0
votes
0answers
10 views

foreach loop in carousel

I have an issue i dont know how to display other posts in carousel slides to display other 3 posts in a row. It's showing me only 6,5,4.. 4 ..6,5,4 I want 1,2,3 -> 4,5,6 or 6,5,4 -> 3,2,1 Slide ...
0
votes
1answer
15 views

R: For loop only works when manually executed

so I have a dataframe with four number colums A,B,C and D I now wrote a for-loop to change values row by row when certain conditions are met. but nothing happens! If I manually set k=1, k=2, k=3 and ...
-1
votes
1answer
41 views

Using a loop to print every other number of an array in c++ [closed]

So i am fairly new to coding but know to do some basics. I have been asked to create a piece of code that starts by printing the numbers normally then backwards which I have managed with for loops ...
0
votes
0answers
13 views

Is there a way to see wich role got deleted / added discord.js

I've been serching a lot about how to check if a user got a role/ got removed one. I need it because it's the only thing I have left to finish my automatic logs ^^' I knew that we have to use an event ...
-2
votes
2answers
44 views

Find the sum of the list below with a for loop [closed]

I wanted to calculate the sum of the list below, but I forgot to write (total = 0) before the loop. I expected to get an error but when I ran the cell I got this output: 55 65 70 Now I'm confused and ...
0
votes
1answer
18 views

looping a ffmpeg command that joins two files

Command ffmpeg -i file-1.mp4 -vf ass=file-1a.ass burned-1.mp4 works to burn file-1a.ass subtitles on file-1.mp4 video. But each time I have to reiterate the same command on over 40 different videos ...
0
votes
0answers
14 views

Foreach loop issue (laravel 6)

I've problem with my foreach loop in laravel 6 project as you can see on image when I click to one tab it's opening all about content in every tab. I know why it's caused but i dont know how to make ...
1
vote
2answers
36 views

R loop through columns in list of data frames

Suppose the following data frame (in reality my data frame has thousands of rows): year<-c(2010,2010,2010,2011,2011,2011,2012,2012,2013,2013) a1<-rnorm(10) a2<-rnorm(10) b1<-rnorm(10) b2&...
0
votes
2answers
36 views

loop through same variables in for loop

How can I loop through each of these variable within a for loop? $prod1 = $_POST['Option1']; //get input text $prod2 = $_POST['Option2']; //get input text $prod3 = $_POST['Option3']; //get input ...
0
votes
2answers
26 views

How To Create Every Unique Combination of X Arrays Include Y number of Items?

The question in the title is the one that I've seen on SO before many times, and I like to share my code snipped to do that. If anyone has any improvements, I like to see them.
1
vote
1answer
44 views

Skip selenium Webdriver.get() call inside for loop if it takes too long

Hey guys I'm having trouble understanding how can I add exceptions to a for in range loop. Right now I'm pulling URLs from an excel sheet and scraping the information while moving throughout the pages ...
2
votes
1answer
28 views

Look up value in data frame stored over multiple columns

I am trying to calculate the average amount of money actors are generating for movies. In my dataset this is defined by gross as shown in a snippet below: movie_title actor_1_name actor_2_name ...

15 30 50 per page
1
2 3 4 5
5102