mardi 12 mai 2020

Subtract a value from every number more than 250 using the if statement in a list in Python?

This the code that I've been using, but it doesn't work.

x=[448.45009861025136,407.926398673343,370.37041013518717,110.80024496401921,
 132.763253167909,290.71258650497805,343.445508200621,90.32213589961538,275.6475130629087,
 286.5755699930108,270.1987754529232,285.9797633022938,125.70236429739884,392.1611941440351,
 123.20295634613336,333.62671024414226]

for j in x:
    if j>360.0:
        x=j-360.0

    else:
        j=j

Aucun commentaire:

Enregistrer un commentaire