Questions tagged as 'bucle-for'

2
answers

Variable and Loop in JavaScript

I'm trying to understand the basics to have solid foundations. At the moment I'm doing an exercise to recover some fictitious tweets. I am making an effort to understand well the reason of all the development of the loop and I have something...
asked by 29.11.2018 / 04:09
5
answers

How to create a rectangle using asterisks in C # (for cycle)

(For) Create a program that asks the user for width (for example, 5) and height (for example, 4) and write a rectangle formed by that number of asterisks, eg: At the moment I have this: Console.WriteLine("introduce el tamañno de cuadr...
asked by 14.08.2018 / 17:16
2
answers

Iterate a list and save it in a file

I am trying to iterate a list and then save it to a file .txt with open/write . lista = ['uno', 'dos', 'tres'] mi_path = "../fichero.txt" f = open(mi_path, 'a+') for i in lista: f.write(i) f.close() I give the attribut...
asked by 12.07.2017 / 11:59
3
answers

I do not work the average inside the for

I'm doing a program, I have a problem with the average that gives me 0, and try to put it out of for and the same thing happens, could someone tell me my error? Sentence: Given the salaries and category of 5 employees is asked...
asked by 09.08.2018 / 22:07
2
answers

List within a for in

I have the following code for (a in secciones){ ncompoa += "<h1>"; ncompoa += secciones[a]; ncompoa += "</h1>"; ncompoa += "<ol>"; for (li in producto) {...
asked by 06.08.2018 / 18:42
1
answer

How to know if a break has been executed

Good, I have a doubt and I can not find an answer anywhere. The fact is that I have in a script a loop for in which I have a condition with a break statement. What I would like to know is if there is any way of knowing if the br...
asked by 26.10.2017 / 13:41
1
answer

Incremental loop between ranges in JavaScript

I have the following Array's (below), and I need to print in increments the ranges of positions that are there, I mean, in position 0 of array1 is the 10 and in array2 is the 15, I need to increase in one and then start from the number that is i...
asked by 14.08.2018 / 17:49
4
answers

Go through 2 lists in java

List<String> DiasSemana = new ArrayList<>(); DiasSemana.add("Lunes"); DiasSemana.add("Martes"); DiasSemana.add("Miércoles"); DiasSemana.add("Jueves"); DiasSemana.add("Viernes"); DiasSemana.add("Sábado");...
asked by 20.04.2018 / 04:35
1
answer

Hangman game - Java

I have a problem with a program I'm doing, which is about creating a Hangman Game. I used a for so that the entered character is equal to one of the characters of the word (which is chosen randomly) and a if to verify if it is corr...
asked by 19.12.2018 / 02:27
3
answers

Compare different ArrayList's in Java

Good evening I would like you to help me in the following: I have 2 ArrayList's: ArrayList<Persona> listaPersona; that its content transforming it into Json is the following: [{"nombre":"Luis", "edad":"22"},{"nombre":"Juan","edad...
asked by 03.05.2018 / 03:39