Questions tagged as 'loops'

4
answers

Will not let me enter the data in an array structure

Excuse me, surely it is something without much difficulty for you but I am just starting in this language, my mistake is something logical that surely I can not understand since I feel that all the arithmetic sentences are made correctly. Keep i...
asked by 15.03.2017 / 00:38
2
answers

Value placement NOT constant in fixes

Good evening, I try to create a C ++ program that combines arrays in for and switch; however, I mark error in the declaration of the variable numbers [p], I know that it is because the number between the brackets must be a constant. My question...
asked by 14.11.2017 / 04:15
2
answers

how do I eliminate the last character of an impression made by FOR in java?

I have: for(i=0; i<vector.length; i++) { System.out.print(Integer.toString(vector[i]) + " < "); } Example: The exit would be    1 < 2 < 3 < 4 < This last sign I would like to eliminate from printing, try substring...
asked by 29.10.2017 / 06:07
3
answers

How the for ... in statement works in javascript

Good, a question has arisen with the function for...in of javascript, and I do not know if it is because I am using it badly, but it does not work for me. I am trying to apply to several elements of the DOM with querySelectorAll an...
asked by 06.11.2017 / 11:35
2
answers

Create objects with similar names with a for cycle in python

I want to create 24 matrices like this: import numpy as np tabla1 = np.empty((25*5,3 + 11)) tabla2 = np.empty((25*5,3 + 11)) . . . tabla24 = np.empty((25*5,3 + 11)) To avoid having to write it 24 times, I thought about using a for...
asked by 06.04.2017 / 00:21
1
answer

The for cycle in javascript, can you alter variables?

I have a question, I found the following code to calculate the factorial number of a whole number, but I am doing my desktop run and I can not understand the code because it is assumed that in the process of the factorial it multiplies by all th...
asked by 06.04.2017 / 21:36
3
answers

Do operations on columns in a Dataframe loop

I want to do calculations on three columns of an array values_array . def calculateAllEMA(self,values_array): df = pd.DataFrame(values_array, columns=['BTC', 'ETH', 'DASH']) for i,column in enumerate(df[column]): ema=[]...
asked by 11.08.2017 / 18:01
1
answer

Problem with functions and loop for

I can not effectively do that while executing the readSuccessB(evt,file) function, pause the loop and resume right after finishing that function. I have tried callbacks creating variables so that if it is running do not call the func...
asked by 31.12.2017 / 03:43
1
answer

Error compiling passing const

There is an error that does not stop to compile and I do not understand, I explain, I pretend to make the power of a language, eg given a language L {0,1}, do L ^ 2, that would give us { 00,01,10,11}. That's what I intend to do in my code, ho...
asked by 04.10.2017 / 02:27
1
answer

I need you to give me 2 different letters

I'm trying to make a poker game to play. The problem is that at the time of telling him that he is giving me two cards from the deck, he gives me only one card twice. For example, you give me Q of heart and Q of heart or...
asked by 29.09.2017 / 06:14