Most voted "break" questions
16 questions
Sort by count of
-
10
votes3
answers6900
viewsWhat’s the difference between Return and break in a switch case?
In some situations it is necessary to practice the switch case for optimization and improvement of code. I have an application developed for Android using Java, which in case is used of both…
-
5
votes5
answers1513
viewsSkip Record within a while
I wonder how it is that I jump a log inside a while? For example, when the guy is 2 he jumps while($pessoa = mysqli_fetch_object($query)){ if($pessoa->tipo == 2){break;} //continua a exibição de…
-
5
votes2
answers181
viewsSimple ways to break a *while* with a function
I usually run into this problem: while True: input_chute = int(input("chute: ")) if input_chute == 0: break bla bla bla ... In that example above I break while with a condition and a break, however,…
-
4
votes1
answer299
viewsHow do I use the break command within two loops in Ruby?
When the "break" command is executed in "if" there is a way to exit the internal and external loop ? not just one ? while (i < maior) do if tam1>tam2 for i2 in 0 .. tam2 do…
-
3
votes1
answer1903
viewsBreak and Continue on Switch
What’s the difference of using the break and the continue within the switch?
-
2
votes1
answer496
viewsPython - Problem printing inside a loop
I have the following code Python, representative of the game Pedra,Papel,Tesoura. import random listChoices = ["rock","paper","scissor"] print("Choose rock, paper or scissor to play or write exit to…
-
2
votes1
answer159
views -
2
votes1
answer88
viewsHow to interrupt a cycle of "whiles"?
Well, I’m going to give a very abstract example in order to be able to express my doubt more simply I have following code: while(a>b){ // Meu while principal while(c>d){ while(e>f){ } } }…
-
2
votes1
answer324
views -
2
votes0
answers248
viewsSwitch Case - Break and Return inside a Function - Arduino
Hello, good afternoon! I would like to understand how the switch case works in the Arduino C++ language. I have the following hypothetical situation: estado_principal=0; estados_Japão=0; setup () {…
-
1
votes1
answer540
viewsStop a Function already started in Jquery
The problem is this. I have a function called showJsonProducts(); I want that when I call another Function it stops running, example: $('.btn').click(function(){ showJsonProducts.stop(); ou…
-
0
votes2
answers417
viewswhile True inside while True
How do I end the while True session completely inside another one? Ex: I did it with break, but it’s only finishing it inside another (while True). look at an example below. while True: test =…
-
0
votes2
answers56
viewsLooping and Finishing? In Python
Hi, guys. I have a problem with my program. I’m not getting it looped until I "shut it down" it. I’ll be leaving his code, making it easier for you to understand. Where the operator selected to play…
-
-1
votes3
answers194
views"break" does not finish execution as it should
Create a program where the user can enter several numerical values and register them in a list. If the number already exists inside, it will not be added. At the end, all unique values typed will be…
-
-2
votes1
answer50
viewsHow to break this code if return is two equal numbers
good afternoon! I have a problem where if the user type, two equal cities, the loop is interrupted. However, even putting a conditional and adding BREAK, the loop does not stop, you can help me?…
-
-3
votes1
answer87
viewsPython - List sorting without Sort()
I was studying this list ordering code and there are some things I didn’t understand: Why is it necessary to break? Why leave the else ident with the if and without the break doesn’t work? Why with…