vendredi 18 novembre 2016

Python If Statment

i have some problem here

my code

ress = []

    number_tag = number_of_starttags + number_of_endtags
    CTTD = words_count + (0.5 * link_words) + number_tag - number_tag_break
    if  words_count + link_number  == 0:
        CTTD == 0
    else:
        CTTD
    res = [words_count, link_words, number_tag, number_tag_break, CTTD]
    ress.append(res)

but the output is not generated as expected. I want to be when WORD_COUNT + link_words amounted to 0 then CTTD will immediately be 0.

what i get now is CTTD still be calculated according to the initial formulation, does not care wheather WORD_COUNT + link_word = 0.

So how to get the right output?

Aucun commentaire:

Enregistrer un commentaire