Skip to main content
-5 votes
4 answers
130 views

I am trying to search for a number in a tuple using a while loop in Python. The program finds the element , but it does not stop and continues to run until the end of the tuple. Here is my code: ...
sneha verma's user avatar
3 votes
2 answers
63 views

I'm trying to find the outbreak time (when the number of zombies >= number of humans) as a function of the zombification rate gamma, using the following code: arrOutbreakT = [] arrGamma = np....
me1ll0's user avatar
  • 33
-3 votes
1 answer
119 views

I want to write a code that finds the derivative to any function and want to take a user input on what type of function they're inputting is. Essentially I tried to write a while loop that only accept ...
Uzair Hafesji's user avatar
-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
0 votes
2 answers
94 views

I have searched everywhere but could not find a solution hence posting here. Partclone prints the status / progress on the same line and it keeps updating this line, I want the progress to be ...
user2107349's user avatar
3 votes
1 answer
90 views

I am trying to re-run a nested for loop within a while loop if the while condition is not met. If the condition is met then I want the inner loop to terminate and proceed to the next iteration of the ...
user3500717's user avatar
3 votes
3 answers
215 views

I want this program to first ask user to start or exit which works fine: #include <stdio.h> int main() { int ask; char ask2; char clip[100]; printf("1.start\n2.exit\n&...
Aadil's user avatar
  • 31
1 vote
2 answers
83 views

I'm reformatting a big file with sample metadata. I have a file (let's call it File2) with the group each sample belong to, with one id and pop per line. My idea was to while read over that file and ...
Pedro Morell's user avatar
2 votes
1 answer
146 views

I'm a beginner programmer learning C as a hobby. I just learned about accepting user input using scanf() and thought it would be a fun learning experience to make a small "game" that runs in ...
gus's user avatar
  • 23
-9 votes
1 answer
146 views

I was trying to get the last word of the sentence using the .find() method in a loop. My code: sentence = "please write a program which keeps asking the user for words" index = 0 substring = ...
krish mundra's user avatar
0 votes
2 answers
167 views

I have this homework program to calculate mpg. The -1 is the sentinel value which is supposed to skip the questions asking the user for gas and miles when inputted. At the moment, the program ...
Smallintestine8's user avatar
0 votes
1 answer
154 views

I am using Nginx + Lua (OpenResty, LuaJIT), and I did some performance tests on various loops. local ngx_log = ngx.log -- https://openresty-reference.readthedocs.io/en/latest/Lua_Nginx_API/#nginx-log-...
C0nw0nk's user avatar
  • 992
0 votes
0 answers
81 views

I've been building a promo-doro timer using the indicatif library, but I notice that the ETA provided by indicatif does not work properly when running the timer logic manually. The timer always starts ...
Nolan's user avatar
  • 23
-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
3 votes
1 answer
96 views

I am working on a simple 2 player dice rolling game and have found a problem that i haven't been able to fix, after a While loop, it refuses to execute an if statement def Main(): global player1_score,...
user30428193's user avatar

15 30 50 per page
1
2 3 4 5
1767