Questions tagged as 'loops'

1
answer

Access element, list list - Python

Very good, I am new to Python and I am now struggling with the lists. I expose what I have developed. Currently I have a program that loads the following data structure through a .csv file. 1,4.0,?,?,none,? 2,2.0,3.0,?,none,38 2,2.5,2.5,...
asked by 01.11.2017 / 16:54
2
answers

Error in conditional with estamento in: "requires string as left operand, not set"

I am creating a loop that will iterate over a list of given strings. For this I have created a set of data on which I will establish my conditions within the loop. But I think I'm doing something wrong because in the Python shell I get the fo...
asked by 03.10.2017 / 22:29
2
answers

Show only the first element of a list in templates

I have a table in which I show an object of sight, these are vaccines, what I want is that, for example, if they already put that vaccine, I will not get the name of the vaccine, only the dates in those who got the vaccines. template.html &...
asked by 09.11.2016 / 20:01
1
answer

Loop from X to Y specified by the user

I want to make a cycle that prints the numbers of the range specified by the user, for example: for the values: 2 and 10, it is printed on the div: 2,3,4,5,6,7,8,9, 10. function loopChecking() { 'use strict'; var numberA = document...
asked by 28.11.2017 / 12:06
1
answer

Using a for in R to generate a table of coin releases

Reviewing the exercises for loops of this site link I was curious about number 5: "Use a for loop to simulate 20 coin tosses 20 times, recording the results (1 = heads, 0 = tails) in a pre-set vector" (own translation) The solution pr...
asked by 12.04.2018 / 22:01
1
answer

Infinite loop of mysql

I have to take out a stored procedure, to simplify fractions (divide by the same numerator and denominator number). However, when I run the script it stays running for a while and the MySQL connection is cut off. My code is as follows: deli...
asked by 29.11.2017 / 00:25
1
answer

Go through and save data from an array with laravel 5.1?

I have the following case, I am sending from the view to the controller some data in the following way: <div id="modalities_1"> <div class="col-md-12"> <h3>Modalidad</h3> </div> <div class...
asked by 29.09.2017 / 16:34
1
answer

Store functions in classes

I have the following exercise to perform a class that calculates several of the properties of a mathematical function.    Consider a y=f(x) function defined in a [a,b] interval. You want to sample this function. To this end, the...
asked by 09.08.2017 / 14:40
1
answer

The if only recognizes me the last element of the array, what do I do?

function comenzar(){ var caja=document.getElementById("caja"); var numero=document.getElementById("numero"); numero.addEventListener("change",background,false); setInterval(background(),50); } function background(){ valores...
asked by 10.04.2017 / 17:49
1
answer

For manner in an array in angularjs

Hi, I have a WS that contains dynamic fixes and I need to save all the variables that have the status 'reserved' so I can use them later. The web service returns these data:    [{"id": "3", "rut_medical": "12883277-3", "date_programmed": "...
asked by 22.02.2017 / 02:56