lundi 22 juin 2020

How to do two operations in two ranges?

I have two operations for two ranges. I want to do someting like:

  • for variable in [0, len(list)-1]
  • do operation 1 and do operation 2 for the second value, which is len(list)
  • and in the end append all the found values
def reg_val_list_binary(s):
    r = [0, 0, 0, 254, 179, 0, 2, 0, 0, 0]
    v = []
    w = []
    for v in (0, len (list)-1):
        r = [int(bit) for bit in str( bin(v) )[2:].zfill(8)] [::-1]
    for v = len(list):
        r = [0] 
    w.append(r)
    return w

I obtain an empty list

Any help please ?

Aucun commentaire:

Enregistrer un commentaire