Category "loops"

decreasing values with loop in Django

in this code, I tried to decrease the quantity of products from the database when the user places the order, it is working but the problem is just decreasing fr

Iterating through list of lists of lists

I am trying to iterate through a 3-D list in python(not numpy but I am willing to convert to a numpy array if this makes it easier) in such a way that from a li

Can't get values past array[0] to translate properly

Okay, to start with I should mention this is a very small personal project, and I've only have a handful of coding classes several years ago now. I can figure o

How to edit and save TOML content in Python

I would like to edit a local TOML file and save it again to be used in the same Python script. In this sense, to be able to change a given parameter in loop. Yo

I want to repeat a function indefinitely [duplicate]

I am working through some exercises on python and my task is to create a program that can take a number, divide it by 2 if it is an even numbe

Python: Iterate through YAML file and output all relevant settings from hierarchy

I'm new to python and am looking for the best way to import a YAML file into Python and iterate through it to collect relevant appsettings for a specific instan

Iterate over lists inside a dictionary

Is there any way to iterate over lists inside a dictionary. A key inside dictionary contains a list which needs to be iterated over separately from the other li

how can I stop the song in the buzzer when there is a bright light coming in ldr sensor?

I tried doing the if else statement for the buzzer. But it finishes the song code first before the else statement runs. I tried running the code and it starts t

List changed in a function [duplicate]

I'm supposed to rotate the list iteratively which means put the first element to the last, and the rest move forward until it back to the orig

Remove Key = NaN within loop for Specific Column

I created a dictionary from a dataframe using a loop. The key are ID's but some ID's are NaN from source. How can I drop rows in the loop where the ID column (w

How to select and click a child div with Puppeteer

I am new to Puppeteer; trying to click on the first div after div with class version-cell create-update. Not all web pages I scrape will have the version-cell c

write each result of the loop to a python list

I have the txt file as follows: 0 1 2 0 // 7697 909 1 // 3536 4921 2 // 1421 6919 3 * 9805 -8620 4 + -862 -5869 ... ...

How to use data files of sub-directories and perform iterative operation in python

I have my jupyter notebook (python script) in current directory. In current directory, I have two subfolders, namely a and b. In both directories a and b I have

How to loop over on different files and save the output with filename in R?

I have several files with the names RTDFE, TRYFG, FTYGS, WERTS...like 100 files in txt format. For each file, I'm using the following code and writing the outpu

Hack assembly language - finding the maximum number in RAM

as a task I have to find the maximum number in the RAM locations 10 to 20 and we have to write the solution into RAM[0]. I have a big problem with getting the i

Finding motifs and position of motif in FASTA file - Perl

Can someone help me with this Perl code? When I run it, nothing happens. No errors or anything which is weird to me. It reads in and opens the file just fine. I

Dead code in eclipse when trying to find the sum of an array

I tried to find the sum of any array by using the for loop but the i++ part ended up being the deadcode unreachable. I don't understand why? public static int

iterate through complex nested json array javascript

nested json structure Json Structure: { "id": "30080", "dataelements": { "Name": "abc", }, "children": [ {

My for loop breaks and repeats the output over and over, also I cannot use Dictionaries in this

My code is a WW2 fact machine and for example if you input "1939" the code should print "start of war". If you input a keyword like "Dunkirk" it should work the

How can I loop one frame with ffmpeg? All the other frames should point to the first with no changes, maybe like a recusion

I want to make a long video from a single image in ffmpeg. I need it to be fastly encodeable and at the end the video should have a small file size. Is it pos