Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
2 answers
130 views

it's not breaking and I don't know why This is the problem section of the code. It is working fine, the try except is fine, and the check if not in range's break is working fine. But not the second ...
Sheep Doom's user avatar
-4 votes
4 answers
180 views

Task: to make console to display a message "Happy birthday!". Number of messages equals the number which user inputs to console. Condition: program should break the cycle, when number of ...
Uroboros First's user avatar
0 votes
0 answers
38 views

Good day everyone. I am writing a script which will parse a flat file with all the information I need, and if a certain variable is too long, or greater than some length, I need to break out of that ...
DanL's user avatar
  • 23
1 vote
0 answers
29 views

I'm creating a multiplication game and am suck on two things. I know they deal with break and continue use. repeating the same question over again until it is right providing an option to quit and ...
Tiffany J Munn's user avatar
1 vote
3 answers
161 views

Suppose I have a piece of C code while(1) { switch(a){ case 1: if(b==1) break;//first break break;//second break } } ...
Turbo's user avatar
  • 87
0 votes
1 answer
52 views

I've tried quite a few solutions so my program is a bit jumbled, but I still can't figure out a way to check for "_" and end the game if there are none left. I'd actually rather have them ...
James's user avatar
  • 1
-3 votes
3 answers
122 views

I'm a beginner to programming and have this task I want to complete. Task at hand: Write a program where the user is allowed to enter their name, then (in a while loop) the program prompts the user to ...
KennyG's user avatar
  • 23
-4 votes
1 answer
83 views

month = {"January" : "01", "February" : "02" , "March" : "03", "April" : "04", "May"...
Đinh Quốc Huy's user avatar
0 votes
1 answer
67 views

I found this bash script to make a menu and it is wonderful except I would like it to stay in the script, return back to the menu after something has been selected unless the last option exit has been ...
Sunyata Nothing's user avatar
0 votes
0 answers
55 views

I'm trying to read a file that has this format: 1 2 3 4 I'm trying to store these values into an array using a while loop: ifstream myfile("file.dat"); int n, i; int myarray[30]; if (!...
theheretic's user avatar
-2 votes
1 answer
69 views

I'm learning to use functions in while loops. My goal is to ask the user for input inside the while loop and use the input as an argument in the function. But if input at any moment is == 'q', the ...
Dumby's user avatar
  • 3
-1 votes
1 answer
70 views

I'm looking for a little help to clean up my code for a class assignment. The code itsself works as intended, but I'm looking for a way to show the ending message without closing out of the program or ...
alyssamessier's user avatar
0 votes
1 answer
82 views

I am learning C right now and im at the very beginning. Here's my code: #include <stdio.h> int main (){ char operator; double num1; double num2; double result; printf("\n Enter an ...
Bunyamin Erkaya's user avatar
-1 votes
1 answer
45 views

Why is the output exactly the same when the labeled break is positioned before the start of the middle and inner loop? Example code 1 - When break point is positioned at the start of the inner loop ...
Rupesh Pradhan's user avatar
0 votes
1 answer
41 views

# importing random module, for random choices import random # print_move function to display CPU and players current move def print_move(current_player, row, stick_quantity): current_player = ...
Raphael Mahna's user avatar
2 votes
1 answer
114 views

When piping the output of a command to a ForEach-Object loop in PowerShell, using a continue statement causes it to error out. Works as expected: ipconfig | ForEach-Object { $_ } Errors: ipconfig |...
DeadChex's user avatar
  • 4,719
3 votes
1 answer
308 views

In many languages there is the BREAK statement, which allows you to escape an iterative cycle. I can't find a word to escape a BEGIN-AGAIN or BEGIN-UNTIL cycle in Forth I want to implement this code ...
user avatar
-1 votes
1 answer
36 views

For Excel use, I want to create a code that represents A1, A2,...D1, ... AB1, AB2, ... field = [A, B, C, ..., AA, AB, ..., YZ, ZZ] data = [[1, 2,3,4,5], [2, 3,4,5,6], [3, 5,4,3,5], [4, 5,6,7,7],...] #[...
kosskoss's user avatar
1 vote
1 answer
65 views

So i'm trying to break out of the switch and while statements using the break in every case, yet even using the break statement my program keeps executing the default after the specific case code is ...
Heaper's user avatar
  • 15
-2 votes
1 answer
101 views

I am trying to learn python. In this context, I work on this exercise: I take a fraction from the user (X/Y) and return a result If Y is greater than X, I prompt the user to provide another fraction ...
Elvino Michel's user avatar
-1 votes
2 answers
249 views

Whenever I forget to increment 'j' and hit run it becomes an infinite loop so what can we do to break the infinite loop in turbo c if I don't have the option of 'Break' on my keyboard? what process ...
Y_Sachin's user avatar
-2 votes
1 answer
126 views

If I want to add a break to my for or while loop at certain iteration can it be done without adding counter? i=1 for line in zip(*input): print(format_row.format(*line)) if i &...
Roman Toasov's user avatar
-3 votes
2 answers
108 views

def main(): dmn_options = ["lenovo", "rasbberrypi", "Exit"] while True: display_menu(dmn_options) user_choice = select_single_l(dmn_options);print(user_choice)...
John Smith's user avatar
0 votes
0 answers
34 views

I am trying to take multiple worksheets from workbook and save them to a new workbook with a new name and destination. when I have (122, 222) to save multiple worksheets its doesn't let me run it only ...
Diana's user avatar
  • 41
0 votes
0 answers
84 views

I would like to print the same message multiple times, each on its own line, with a blank line in between. This is what I'm hoping for: This store is closed today This store is closed today This ...
Khelang-Roman's user avatar
-1 votes
2 answers
90 views

I want to print the "bye" after breaking the True while, but I'm having trouble. Here is my code while (True) : number = (input("pleas enter a number : \n")) if number == ...
aedan's user avatar
  • 7
0 votes
2 answers
155 views

I'm trying to use Tkinter to start a while loop when pressing the "on" button from an option menu and stop that while loop when pressing the "off" from the option menu. The while ...
Alex's user avatar
  • 21
-1 votes
3 answers
131 views

I created a silly function to see if a string contains digits or not. def check_digit_placement(w): if w.isalpha(): return True else: i=0 while True: if w[i]...
Dick Grayson's user avatar
2 votes
1 answer
42 views

I am trying to ask a user if they would like to try again a new computation, I used old code from another lab I had but can't seem to get it to adjust proper for this new one. My problem is that when ...
Spongebuild's user avatar
0 votes
3 answers
72 views

arr.add(mas[0]); for(int i=1;i<mas.length;i++) { for(int j=0;j<arr.size();j++) { if(mas[i].equals(arr.get(j))||mas[i].equals("")){ break; ...
GeorgeAndGuns112's user avatar
2 votes
2 answers
98 views

When my code checks if an input is an integer or string it goes into an infinite loop of outputting "invalid input" and "guess a number between 0-9" without giving the user a ...
kakarot 22's user avatar
-3 votes
1 answer
58 views

So im currently using EPPLUS in C#, trying to get some data from an excel file. It's working BUT, break; makes my head go "boom-boom". There are segments in my for loop that if i put the ...
deinmar_krain's user avatar
0 votes
1 answer
114 views

I need break FileList FOR loop in error case in HttpClient Observable. I make a request with post method for upload 1 file for each loop iteration. This is my code, but not working, not breaking loop. ...
Juan David Luna's user avatar
1 vote
0 answers
87 views

I can think of a number of cases where block_return or return_block would be useful, but particularly in the case of yield. For example, the common problem of something like: def with_file(name) f =...
David Ljung Madison Stellar's user avatar
-2 votes
1 answer
82 views

How do i get my code to stop running the non stop 2. what am i doing wrong with this addition i =+ 2; using System; namespace TestingNewShit { class program { static void Main(string[] ...
benedict Cherlet's user avatar
1 vote
1 answer
145 views

it's a weekend and my professor isn't answering emails, we went over break statements in class and I was sure I understood it, but I keep getting questions like this wrong (it wants you to show the ...
Ben Turner's user avatar
1 vote
1 answer
998 views

I decide to play around loop just to understand how loops work in bash. But I am the one who got played. All I know is the the break call helps to stop a particular loop echo "For loop begins&...
SinaMathew's user avatar
0 votes
1 answer
402 views

I want to stop the simulation when my output reaches a certain limit or value irrespective of the simulation time. Let's take an example my output is 'prod' a variable which has the product of two ...
kunal's user avatar
  • 1
0 votes
1 answer
49 views

I am a beginner. I am creating a very basic calculator. I want to break the program when the user gives the command as "STOP". Here's my code: while d=="yes" or d=="YES" ...
Prabhaan Goyal's user avatar
1 vote
1 answer
3k views

When the answer is "Non", i need to get out of both if loops to continue with the program and i dont know how to do so, it only breaks from the inner one. this is my first proyect and im idk ...
Avril's user avatar
  • 11
0 votes
0 answers
330 views

I have an issue with very simple piece of code: def cond(x,y) if x =~ /#{y}/ puts "ok" else puts "not ok" break ...
mila002's user avatar
  • 385
-1 votes
1 answer
68 views

So here's simple structure of my code: while condition: for i in range(num): for j in range(num): if arr[i][j] == something: #DO SOMETHING #...
Softly's user avatar
  • 1
-3 votes
2 answers
56 views

when i run this code in terminal** i should prees" enter " key to run after line 6 ** i dont know the problem i'm in the learning python proccess thank all of you in advance........ print(&...
misagh 's user avatar
-1 votes
1 answer
79 views

machine = True money = 0 def game(): global money, machine while machine: order = input("What would you like? (espresso/latte/cappuccino) ") # Gets order machine = ...
MaximusPrima's user avatar
-2 votes
2 answers
1k views

I am new to programming and I came across these two similar problems: Example 1: for i in range(10): if i == 5: break else: print(i) else: print("Here") Output: 0 1 2 3 4 ...
aravindh sankar's user avatar
1 vote
3 answers
63 views

String1 = “Python is an interpreted high level general purpose programming language” List1 = String1.split() for i in List1: for j in i: if i.count(j)>1: List1.remove(i) ...
mounica gvs's user avatar
2 votes
4 answers
176 views

In Java, it is possible to escape from an outer loop using such a construct: int[][] matrix; int value; ... outer: { for(int i=0; i<n; i++) for (int j=0; j<m; j++) if (matrix[i][j] ==...
Alexander Gromov's user avatar
-3 votes
1 answer
97 views

when some one attack like DDOS or Dos in our computer for example someone like hacker let's say run infinite loop in your terminal to open the gnome-terminal code:-- while : do gnome-terminal done ...
HackingwithHarry's user avatar
0 votes
2 answers
94 views

Just beginning with C and noticed this detail. Not a pressing question, just curious. I tried searching for the answer but couldn't seem to find an explanation. (not sure what else to say, this ...
jktannerman's user avatar
6 votes
2 answers
3k views

When I write this code void main() { var age = 18; switch(age){ case 18: print("Age is 18"); case 22: print("Age is 22"); default: print("...
Omar Azzam's user avatar

1
2 3 4 5
53