Questions tagged as 'array'

1
answer

list dictionary elements and a list in a line

Hi, I'm doing a test with lists and dictionaries, I got to a point where I had something like that. datos = {'key1':'a','key2':'b','key3':'c'} dic = ["alfa","beta","gama"] My intention is to print a,alfa b,beta c,gama I tried it with a...
asked by 30.06.2017 / 06:20
2
answers

Replace a character of a string and show the final string with spaces included

Basically my code is ready, the only problem is that when I show the modified end string, it only shows me the first word (When it finds a space it ignores the rest) I know that my program stops counting when it meets "\ 0" and I also know that...
asked by 24.03.2017 / 16:07
1
answer

Calculate the value (ASCII) of each word (sum of the value of the letters) of a sentence within an array

I'm doing an exercise that is about calculating the value of each word in a sentence that the user enters. I wanted to know if you could help me know how to do it, thanks! What I want to do is calculate the value of a word, or the same, calculat...
asked by 13.12.2018 / 13:44
2
answers

How to know if several periods of time overlap?

I need to iterate an array of date objects, with duration and get how many overlaps each of them. But I'm looking to do it efficiently and quickly. I'm looking for frameworks to manage time periods but I have not found anything. I develope...
asked by 23.02.2016 / 14:12
2
answers

Mix two arrays in one. Java

I'm new to the world of programming, I'm trying to mix two arrays into one, each with the dimension that we choose, and filled with randoms. But when it comes to mixing them, printing the first of the first array, first of the second array, seco...
asked by 30.11.2017 / 18:18
1
answer

Browse JSON Array in PHP [duplicated]

I need to run a JSON array in PHP give me back the following: { "SU_Result": { "SU_BE": [ { "proABREVIATURATITULO": "", "proAPELLIDOMATERNO": "", "proAPELLIDOPATERNO": "", "proNOMBRES": "",...
asked by 18.12.2017 / 16:28
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 / 15:49
3
answers

Merge arrays ordered in C ++

I need to combine the elements of two arrays interspersed and sort them during insertion. However, something strange happens when I order the second array ( arreglo2 ), since it modifies the first element of the first array ( arreglo1...
asked by 27.09.2018 / 01:12
1
answer

Add data obtained mysqli to a multi array

I'm trying to add the data obtained from a select and order them to an array in PHP. I want to accommodate the array in this way: $array = array(noticias => array("1" => array ("titulo" => "Noticia 1", "autor" => "Pepe", "fecha"...
asked by 06.08.2018 / 21:38
1
answer

Php array String

Hi, I have this code in php to visualize the values of the array but I get an error of Array to string conversion and I do not know why. Code: <?php echo "<h3>Diferentes formas de array</h3>"; echo "Funcion array()...
asked by 26.09.2017 / 18:22