正规365体育投注

Questions tagged [loops]

Loops are a type of control flow structure in programming in which a series of statements may be executed repeatedly until some condition is met.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Create megred files via a for loop in Matlab

I have a question. I have created a code which use a loop with two iterations. Each iteration creates 25 .txt files (as I said previously) , and with the use of the above code I megre them in one file....
0
votes
0answers
10 views

How to do it so that the field(armadaHrace2[VyberVojaky] can be listed and used with it?

How to do it so that the field(armadaHrace2[VyberVojaky] can be listed and used with it?Next to is translate.This array armadaHrace2[VyberVojaky] I want use it for fight,but it show it error String ...
0
votes
0answers
21 views

Switch rows in data.table to create uniform variable

I want to write a script to help me distribute piglets over pens while maintaining a similar average weight between pens but only switching piglets which have the same mother. So far I got the ...
0
votes
0answers
4 views

Creation of the value of a column inside a loop, depending on the selection with python

I have several dots (lowercase letters) that I want to group based on their position with the 'A' dots (in uppercase). The idea is to make a loop, where for each point 'A' a selection is made and in ...
0
votes
1answer
33 views

Python while loops issues

I'm wanting this code to constantly keep spitting out the variables {actual, wb, pbactual, pbsim}, which is what I have right now but I want wb and pbsim to be different values eachtime, because right ...
1
vote
0answers
19 views

How can I make python code loops go into different excel cells each loop after input?

Here is what I have done so far # create file (workbook) and worksheet outWorkBook = xlsxwriter.Workbook("out.xlsx") outSheet = outWorkBook.add_worksheet() # Putting in specific position outSheet....
0
votes
1answer
30 views

How to increment a foor loop within a nested if statement

Im distinguishing 2 players in TicTacToe by utilising MOD, which is used upon an incrementing for loop. Im having trouble incrementing the foor loop within a nested if statement. for i ...
0
votes
1answer
9 views

Problem with requests.get() inside a loop. “No connection adapters found”

So I'm trying to scrape several pages using their JSON versions. When I run the code for a single URL (as in the first part of the code attached), I do get the desired output, however, when I try to ...
0
votes
2answers
40 views

How to create random numbers a specific number of times?

How can i create a random number a specific numbers of time? public class Feld { public static void main(String[] args) { double k = (int)(Math.random()*1000001); int n = 1000000;...
0
votes
0answers
40 views

Sorting the array according to the alphabetic order of the last names of the students

Sort the array according to the alphabetic order of the last names of the students and print the array to the console. But the code does not show the output correctly, why? If i give input, Suppose: ...
-7
votes
0answers
26 views

Write a program with ​Nested​ ​FOR LOOP ​to output the lines below: [closed]

Write a c code with ​Nested​ ​FOR LOOP ​to output the lines below: 2 2 2 2 3 3 2 2 3 3 4 4 2 2 3 3 4 4 5 ...
-3
votes
5answers
61 views

Change for-loop to while loop [closed]

How to change the for-loop to a while loop? for (i = 0; i < arr.length; i++) { if (arr[i] == k) { found = true; break; } } Code: ...
0
votes
2answers
32 views

Sort the array according to the alphabetic order of the last names of the students

Sort the array according to the alphabetic order of the last names of the students and print the array to the console. But the code does not show the output correctly, why? If i give input. Suppose, ...
-1
votes
0answers
28 views

I need to make 4 squares move vertically using a loop

I need to make 4 individual squares that move vertically and when they touch the window edge they change directions. I can do it with one square but how do i do it with 4 to avoid repeating the loop. ...
0
votes
2answers
36 views

Why are these loop & hashing operations take O(N) time complexity?

Given the array : int arr[]= {1, 2, 3, 2, 3, 1, 3} You are asked to find a number within the array that occurs odd number of times. It's 3 (occurring 3 times). The time complexity should be at ...

15 30 50 per page
1
2 3 4 5
4833