Questions tagged as 'loops'

3
answers

Operators + = and / = with while in Python

I am starting to study Python through an online course. Although I have worked in R for a couple of years, and in general, I think the programming has many similar bases, there are notable differences. One of the most obvious ones I have...
asked by 23.08.2017 / 20:49
2
answers

+ = does not work for me inside a Loop for of

I'm doing an ATM Javascript exercise and it works well, but I thought about improving it by validating the amount of money requested against the amount of money available in the ATM, so I did a "for of" cycle to get the sum available like this:...
asked by 08.06.2017 / 23:51
1
answer

Paging iterations of a for cycle in Javascript

First of all I want to clarify that I do not take for granted that this can be done. My query is if it is possible to page the results of a cycle for in Javascript , let's take the following sample code: var i = null; for (i = 0; i <...
asked by 06.04.2018 / 02:31
1
answer

Error with promise and cycle for

I'm starting with Javascript and I still do not handle the asynchronous topic well, promises ... etc The question is, that within a callback I need to access the data of an array (traverse it through a for) and this throws me an error that I...
asked by 31.08.2017 / 13:47
1
answer

Combinations / possible pairs in the same array

I want to pair all the elements of the same array together, but one element can not be paired with itself. The code I got is the following: function combine(list) { var pairs = new Array((list.length * (list.length - 1)) /...
asked by 13.11.2017 / 12:31
3
answers

In java the integer data types are applicable in the for each loop?

I have searched for examples to understand the for each loop and most examples only show using the type String for example declare a array type String and then use the loop for each . Well, the point is that...
asked by 05.09.2017 / 08:51
3
answers

How to add events to a list of buttons in a cycle with Jquery?

Good, I have this in my Jquery code: $("#borrarImagen0").click(function() { editarImagen(0); }); $("#borrarImagen1").click(function() { editarImagen(1); }); <script src="https://ajax.googleapis.com/a...
asked by 11.09.2017 / 14:22
2
answers

How can I store data from a form to an array in Javascript?

Good I would like you to help with this simple form, it is that you can capture 3 numbers from the form, that you can store them in a vector and show them with another show function. I can not make him keep the data, he just repeats it to me. Do...
asked by 10.04.2018 / 02:42
1
answer

error recorer string with for in r

I want to go through a text string using a loop, but when I run the code, it only makes the first iteration. text <- "CTGGTGCTCGTAGACCGCAGAACC"; i=0 i1=i+3 for (i in 1:length(text)){ DNA <-substr(text,i,i1) i=i1+1 i1=i+2 print(DNA) }...
asked by 27.10.2017 / 10:26
1
answer

Doubt with LOOP FOR (now in PIC C COMPILER)

How about friends again, they already answered my question, but I work on a compiler of C, now I'm programming on pic C compiler, but it marks me that the second loop becomes infinite (it's always true, it executes normal, but at end begins to t...
asked by 05.01.2018 / 18:40