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
-
-3
votes1
answer96
viewsjquery - capture content from all Divs with a set class
I have an agenda I want you to hide when every day of the week is closed. So I did this function that analyzes if the content of the day is Closed and if all 7 days have Closed it hides the agenda.…
-
-3
votes2
answers56
viewsStop the loop or not
Good morning, I’m having difficulty putting a condition in this loop: if tighten 1 loop for loop if tighten 2 out of loop resp=1 while resp==1: cliente_nome.append((input("Digite o nome do Cliente:…
-
-3
votes1
answer52
viewsHow do I check if a STRING has more than 3 characters?
I need to check if a string has more than 3 characters, how do I do this? I’ve tried it like this: nome = input('Digite um nome: ') a = [i for i in enumerate(nome)] print([i for i, y in a]) if a…
-
-3
votes1
answer55
viewsrepeat loop - while
Hey, guys! All right? I’m not able to develop an algorithm in Javascript that "Ask the user to enter a number n and add all numbers from 1 to n" using while only. Would anyone like to help? Tks…
-
-3
votes1
answer36
viewsHow to store values at each interaction during the repetition of a structure - Python
lista= ["2,55","3,4","3,83","5,1","6,8"] for i in range(len(lista)): lista[i] = lista[i] #PREEENCHER VALOR navegador.find_element_by_xpath('...').send_keys(lista[i]) time.sleep(3) #obter valor #…
-
-3
votes2
answers54
viewsLoop to find correct combination
I recently built a simple algorithm to find correct combinations with the following url:…
-
-3
votes1
answer45
viewsStop loop with typed text
Hello, I’m new to programming and would like to know if I can stop this loop when the user type "Quit" in the dialog box "Enter your name". public class PeriodoDeVacinacao { public static void…
-
-3
votes2
answers63
viewsInfinity C loop array
In this example below, how do I print on the screen all values assigned to n during the loop, after its completion? #include <stdio.h> #include <conio.h> int main (void) { int n; for…
-
-3
votes3
answers105
viewsHow to create listeners for multiple elements in a loop?
My code is very repetitive, I want to use a loop to solve this, but I don’t know how to do it. $(document).ready(function() { //Atribui aos campos de código do Pokemon a função que carrega os dados…
-
-3
votes1
answer23
viewsForce the user to answer a valid alternative in a multiple choice Python question system
The code below works well, but I would like it to ask the specified question again if the user does not type one of the three available alternatives. perguntas = { 'Pergunta 1': { 'pergunta':…
-
-3
votes0
answers33
viewsTry Catch in infinite looping
Whoa, guys, blz? First time here and I’m starting to learn Java as my first programming language. Okay, my teacher sent me a challenge to make a simple program that asks the user for an…
-
-4
votes2
answers56
viewsBuild error
I started AI recently and I don’t get much of this... The idea was to use the while to show us all even numbers up to 100 but is always giving error and could not fix this yet. while (i <= 100) {…
-
-4
votes2
answers259
viewsGet the position in a for loop in java?
My java code: for (Construtor usuario: users){ Construtor USER = new Construtor(user.getNomeUsuario); arrayList.add(USER); } ** How do I get the position of the loop in this configuration above? See…
-
-4
votes1
answer136
viewsGo inside another For
Guys I’m needing to run a for inside another for but I’m not getting it. I need to store the result value within a variable. I’m not familiar with python, I believe this is the biggest problem.…
-
-4
votes0
answers16
viewsCalculate the mean and standard deviation of a list in txt
I need to calculate the mean and standard deviation for each line of the file "numeros1.txt". In the picture I was able to calculate for the first line, and I need a loop of repetition to do for the…
-
-4
votes2
answers52
views -
-4
votes1
answer43
viewsHow to repeat all the code at the end of the execution when "While" repeats only one part?
I’m doing a program that calculates a person’s pay based on the number of hours and overtime worked. The idea is that at the end of the execution the user decides whether to recalculate or terminate…
-
-4
votes1
answer32
viewsCreate a program that reads a number between 2 and 20 and generate a screen with the configuration shown below:
the program must display the following result: Type a random number between 2 and 20: 7 Exit from the program: 1234567 x123456 xx12345 xxx1235 xxxx123 xxxxx12 xxxxxx1 (NOTE: the value typed by the…
-
-5
votes1
answer110
viewsUsing the code below, why am I only collecting data from the last page of the Loop?
rm(list=ls()) options(warn=-1) library("RCurl") library("XML") baseurl <- "http://www.gmbahia.ufba.br/index.php/gmbahia/issue/archive?issuesPage=XX#issues" dados <-…
-
-5
votes1
answer106
viewsArrays in loops
I could not resolve the following doubt: Fill in the blanks to print all elements of a array arr containing 3 elements: for(int x=0; x<___; x++){______<<______[x]<<endl;}…
-
-5
votes2
answers1037
viewsHow to make an infinite count loop in Java?
I am starting my studies with Java now and I would like to know how to do an infinite count I’m having difficulties, because I know that in Python it would be something like: a = 0 while True: a = a…