Category "loops"

python 3 how to generate multiple random element in list for loops

I'm doing a coding exercise and it's to build a password generator. I understand I need to utilize the for loop with the list containing the elements but I'm ha

Remove not increasing rows based on other columns values

I have a data frame on R and I want to remove all rows that are not increasing in my column 3. Each row have to be higher or equal than the previous one. But m

What is While Feof alternative for big file downloads?

I use this while loop to fetch the file; <?php while(!feof($fp)){ //get this file with feof but dont tell file location on the server $buffer = fread($fp,

How to stop a while loop after n iterations?

I'm learning python and I am trying to create the guess game with two levels of difficulty: easy (10 tries) and difficult (5 tries). My code works well, but I n

Nested loop not iterating through entire list

I'm having a problem with my nested loop. I have a list of titles and a list of keywords, and I want to create a new list containing all of the titles that cont

How do I tell my program to go back to a certain point after the wrong answer is selected?

In my midterm CYA game, you come across 2 staircases, left and right. You have the option to choose which one you go to, the right advancing you and the left (e

How to iterate over references in a python loop ( for x in range() )

I have a bunch of references for different filenames at the start of my code: _file1_="filename1" _file2_="filename2" _file3_="filename3" _filew1_="anothername

Problems concatenating arrays by session

I apologize in advance for the title, my question is not that easy to explain on it. What I mean by that is the following: Having an array of type, 4x4, it has

Is there a simpler way to hide a message in text?

I'm a newbie in Python. I have a sample.txt with random generated numbers, like: 190372210335873910924370795570288776927025955114012905862203094277820432758989

How to use created functions argument inside the code?

When I create a function and use arguments as variable names in group_by() function there is error: comb <- function(z,x,y) { df <- z %>% group

Looping problem Elden ring runes per level calculation

This code is currently showing the total amount needed to reach the next level, but what I would like it to do is show the complete total amount so for example

Create dynamic sub array from a big one [duplicate]

I have an array, made by using explode and the delimiter #. I'm trying without success to create from this big array in PHP subarrays (the num

Skip clicking on an element in the While loop, when opening a popup with selenium. Problem with While loop

This loop scrolls through the list of names on a web page and clicks on each "Add" button next to the name. It works well and correctly wait = WebDriverWait(dri

My php code loops and doesn't explore my database [duplicate]

Hello I'm currently trying to create a page based on a database under mysql that would update itself for a client. However what I'm trying to

Is it possible to have multiple loops that run independently?

I am trying to insert 2 different ranges "x" amount of times based on the input from the user. The user chooses how many mounts they need "D22" and a range is c

How to create a mosaic from different shapefile in R?

I have 37 shapefiles with different names.Individually each of them represent a different part of a country. I would like to create a mosaic of my 37 shp to jus

Unchecked Input For Loop Condition while running checkmarx on angular 13 project

While running the checkmarx on angular 13 project the report results a 'Unchecked Input For loop Condition' medium issue. Even after limiting the object length

How to apply code to dataframe by condition?

I have the following dataframe: library(dplyr) library(tidyverse) library(concordance) Year <- c(2016,2016,2017,2019,2020,2020,2020,2013,2010,2010) Pf <-

python iterate through a list and skip n iterations within the loop every time a condition is met

the following code iterates through a list and counts every time the condition <10 is met. What I want to do is that once this condition is met, the next poi

add Array using for loop (JS)

I'm recreating a hangman game where I create a random word and conceal this with "". i.e if the word is "monkey" then the array should be ["", "", "", "", "", "