Most voted "loop" questions
Loops are a type of flow control structure in programming in which a series of statements can be run repeatedly until some condition is satisfied.
Learn more…671 questions
Sort by count of
-
0
votes2
answers142
viewsManipulation of items during iteration
In Python it is somewhat common to go through items of a everlasting handling or verifying the existence of a particular item, or whatever the operation is. I am reading the Python documentation…
-
0
votes0
answers62
viewsLoop inside the submit button
I have the submit button that must submit the grade to a class of students. But when I click the button, it only submits the grade to the last student on the list. The student list and note list are…
-
0
votes1
answer60
viewsXOR operation by filtering my list values in Dataframe columns
I have several lists and a single dataframe, my goal is to filter my columns that contain the same values from my list and create a dynamic XOR operation. When you find my XOR result equal to 0, the…
-
0
votes0
answers56
viewsLoop for was supposed to run 5 times, but runs only 1
So I’m having a problem with a loop for in the code below: for i=1,#collisionBlocks do t=collisionBlocks[i] print(#collisionBlocks) print(i) if player.y-1<t[4] and player.y-1>t[2] and…
-
0
votes1
answer108
viewsWhile and Rand() loop voting system
I’m making a website with a voting system, but the images change places with the function Rand(). So far so good, but when it comes to voting, when I click on a button, the only one that works is…
-
0
votes0
answers37
viewsVariable value increases +1 within Thread
I am trying to change the color of the Datagrid line and this is easy. However, something is happening with the variable value idxRow2 when this is accessed in the new Thread. The problem is in the…
-
0
votes0
answers66
viewsProcess in Ode being terminated alone
I am using blinktrade’s Ode documentation to receive deposit notifications on Bitcoins, but the Polling process is being terminated by itself thus disrupting the functioning of my system, how can I…
-
0
votes1
answer125
viewsMake a list without EACH in Rails
I would like to know how to create a product listing. Where I have a part of the system that creates a customer and then I can place an order for that customer. By selecting the customer I can add…
-
0
votes1
answer1089
viewslist multiple ngFor arrays
I need to list all subcategories in a table and I’m not sure how to do this. { "message": [ { "category_id": 1, "shop_id": 1, "category_name": "Bebidas", "status_cat_css": 0, "status_cat_active": 1,…
-
0
votes1
answer48
viewsSelect select option according to url parameter
i have the script below that takes a parameter from the URL(if it has), searches all selects of the page and selects the option with the same value(same value of the parameter). If you don’t have a…
-
0
votes1
answer44
viewsWhat’s wrong with the code? He was supposed to check while, but when I type continue or cancel he keeps repeating!
System.out.println("Qual produto você deseja verificar a disponibilidade? "); System.out.println("Digite: Prato, Copo, Talheres, ou Cancelar para sair! Ou continuar " + "para dar seguimento a…
-
0
votes1
answer118
viewscompare Array with another Array com for in Java
Everybody, Good afternoon. I am wanting to compare 2 Array, where 1 array has randomly set value. I want to use for so I don’t have to repeat 100 times. But I don’t know, because it always shows me…
-
0
votes2
answers444
viewswhile true x loop
Developing some scripts in Ruby I come across the following situation: There are indeed several Repetition Structures, but 2 in particular caught my attention. while true and loop do. Both generate…
-
0
votes1
answer46
viewsr Loop by script condition
It is possible to loop from this data? library(dplyr) mes <- c("jan","fev","fev","mar","jan","nov","mar","mar","mar","jan","nov","maio","maio","maio","nov","nov","mar","jan","mar","jan") a <-…
-
0
votes0
answers114
viewsGraphical interface with Tkinter slowing my code
I’m making a little script to automate some things on Windows only one problem I found is to close it (after having converted to executable with the auto-py-to-exe) has to make millstone trampo,…
-
0
votes2
answers78
views -
0
votes1
answer985
viewsHow to print a string in C?
I’m studying C and I want to make an algorithm that reads the names of 30 students in a class and returns the highest grade, lowest grade and the names of these students. I have already researched a…
-
0
votes1
answer47
viewsphp loop of images with bootstrap
I have this code that brings some Instagram images, I want to stay 3 photos by row (line); Then if there are more than 3, create another Row. my code: <div class="row"> <?php foreach…
-
0
votes1
answer401
views -
0
votes1
answer49
viewsHelp with nested loop
yhat_tr is a column of 500 items. d_tr, tb with 500 elements, is another column, which I loaded separately from the first, are different sources, but with the same indexes. My code is this: TP, FP,…
-
0
votes0
answers61
viewsUri 1160, beginner using visualg, repeat
The problem is in https://www.urionlinejudge.com.br/judge/pt/problems/view/1160: Mariazinha wants to solve an interesting problem. Given the population information and the growth rate of any two…
-
0
votes0
answers60
viewsHTML5/Avascript loop video snippet
Is there any way to loop a particular snippet of a video until the user clicks a button using HMTL5/Avascript? My question is about the loop, but I will contextualize at the request of colleagues…
-
0
votes1
answer66
viewsloop for Jinj2 flask
I have a loop 'for" in the template only I want it to show a certain amount result. {% for form in form %} <tr> <td><img src="../static/img/arrow-gray.png" alt=""> <font…
-
0
votes1
answer2511
viewsHow to loop a dataframe by conditionally removing lines and restarting the loop in a recalculated dataframe at each removal?
Hello, I am performing some data processing and I need my algorithm to perform the comparison between two lines and remove the worst one, according to some conditions. Each time the algorithm…
-
0
votes1
answer116
viewsAccess out-of-loop variable for
As access to variable cookies out of the loop? cookies = [] for i in get_cookies(url): cookies = '='.join(i) + '; ' print(cookies) Is just returning this:…
-
0
votes1
answer58
viewsQt Error: ASSERT Failure in Qlist<T>
I am new using Qt Creator and am currently working on a project for college and am getting the following error ASSERT Failure in Qlist::Operator[]: "index out of range", file .. /.. /. /..…
-
0
votes4
answers712
viewsHow to access only the first position of each row in an array of arrays (matrix / multidimensional array) using foreach?
I have a array multidimensional / array of arrays / matrix (as you prefer to call): public string[,] operacoes = { { "SOMA", "", "" }, { "SUBTRAÇÃO", "", "" }, { "MULTIPLICAÇÃO", "", "" }, {…
-
0
votes1
answer96
viewsAssigning values to repeating variables
I was doing an exercise on the Fibonacci sequence and I was quite confused by the question of assigning values to variables within repetitions. I found a solution as if by luck and ended up not…
-
0
votes1
answer130
viewsProblem with loop in React
This is a common loop problem in React, which is basically making hundreds of flames in my Aces. The component apparently isn’t inside the loop,. component: import React, { useState, useMemo } from…
-
0
votes1
answer48
viewsDuplicate records in the database table
I have the following model: function validarQuestionario() { if(is_array($this->input->post('resposta[]')) || is_object($this->input->post('resposta[]'))) { foreach…
-
0
votes2
answers103
viewsPercorer 2 Distinct Arrays and Verify Which Values are Equal
How to go through 2 distinct arrays to verify which values are equal and after the check print only the equal values of both arrays? The arrays' structures are in the following form below, I tried…
-
0
votes1
answer80
views -
0
votes3
answers655
viewsHow to repeat these commands in Python
I would like to know how I make a command for the program to keep repeating this code a certain amount of times. I want him to repeat this code in one minute:…
-
0
votes1
answer119
viewsPopulating a dictionary of dictionaries through a for loop
I’m trying to create a loop to add information in a dictionary. The most external key of the dictionary will be the name of a course, and the value will be another dictionary, there will be 6 keys,…
-
0
votes1
answer54
viewsLooping ignores the rest of the program
I was writing a program to calculate Paypal fees to help some friends of mine, but in my section against user faults, if the input is not specified, the looping simply ignores the rest of the…
-
0
votes1
answer69
viewsExercise of the book Eloquent Javascript
Hello, I’m a beginner in programming. I’m using the book for my studies in Javascript Eloquent Javascript. I do not understand the operation of the code below: Code var JOURNAL = [ {…
-
0
votes1
answer43
viewsLoop to append Googlesearch to multiple elements of a list
Hello, What’s up, little community? I am a beginner with Python and programming in general and I would like to ask a question. Briefly describing the problem: I am using Googlesearch to return the…
-
0
votes1
answer315
viewsHow to make a menu repeat itself until a variable option?
I am making a program in C++ that must generate three numbers and organize them according to the user’s choice, two options are provided and he must choose one, but I don’t know how to make the menu…
-
0
votes1
answer489
viewsRender Dynamic Input Values - Vuejs
I am doing a project with Vuejs that has 1 form and its data is rendered on the screen, however, this form has options to add more inputs and consequently render this data as well. Then I get input…
-
0
votes1
answer55
viewsLoop for resetting the control variable in c++ Qt Creator
Good night. I’m making a program that converts numerical bases into Qt Creator using C++, and the function that converts from any base to decimal, has a loop for: int toDeci(QString str, int base) {…
-
0
votes1
answer1695
viewsHow to add values of an object array[JS], with only functions and loop for?
That is the question: Sum of expenditure and revenue Create a program that calculates the sum of revenue and expenses of users and at the end returns the balance (revenue - expenses). Use the user…
-
0
votes1
answer62
viewsCount occurrence of events traversing columns of a dataframe through a for loop in R
Hello, I am using the table() function of R to count the repeated notes in each semester column (sem1, sem2,sem3...) of my file. It’s working properly, but I’d like to do it through a loop for and…
-
0
votes1
answer152
viewsHow do I join texts in a Textarea with Js?
I’m trying to make a tabulation, where the result would be shown in an already existing textarea in HTML. I am using innerText to insert the text in this textarea, only the text is being replaced…
-
0
votes1
answer97
views -
0
votes1
answer452
viewsError making a loop for comments on instagram, who helps me? Python Selenium
I need to make a loop that picks up line by line from a file. txt and post as comment on instagram. Through a test I managed to print the first 10 lines of a file. txt arquivo =…
-
0
votes1
answer58
viewsHow to use i no for value in a function?
I have the following code: select = Select(driver.find_element_by_id('Identificador')).select_by_visible_text('Maio/2019') form = driver.find_element_by_name('Formulario')…
-
0
votes1
answer75
viewsHow to store numbers in a vector to display it later in C?
I have to make a code in which the user type 20 values, I must count the values greater than 10 and then display them later. I am able to count how many values are greater than 10, but the display…
-
0
votes1
answer473
viewsHow to insert the value of an Array within another Array
I’m trying to separate students according to their numbers in the notebook where students grade A would be students numbering over 170, students B students numbering 160 to 169 and students C…
-
0
votes1
answer40
viewsReturn all JSON items with forr
Come on, guys, I need some help. I have a Function GET http and returns an array of JSON objects and would like to return the data contained in these objects, currently it returns like this: {…
-
0
votes1
answer56
viewsWhen a validation is negative I would like the program to return, so I can enter the data again
I have a switch that validates 5 cases, but already in the first if you do not enter a number that is not among 5 of mine case, it shows that the option is incorrect and closes. I wish the program…