[Python] Looking for specific values in nested loops

Discussão em 'Python' iniciado por Stack, Janeiro 31, 2025.

  1. Stack

    Stack Membro Participativo

    I am only looking for a logic to look for the increasing values of w,l pairs, for example, l=80, w=100 , bl=all_values, and then the next pair is l=180, w=400, bl=....

    What kind of logic could I use in between bl loop and length to implement this?

    import numpy as np

    width = range(100, 2700, 300)
    length = range(80, 900, 100)

    bl = np.arange(0.9, 1.6, 0.1) # Floating-point range for bl_set

    for w in width:
    for l in length:
    for bl_set in bl:
    print("l=", l, "\tw=", w, "\tbl_set=", bl_set )

    Continue reading...

Compartilhe esta Página