Question: I am currently coding a very simple python script and i am quite new to python, and my question is:

how can I do that so if the user doesn't write anything as input, that it doesn't implement the variable in the calculation?

Here the code:

```
def Calc():
    elif whatDo == "2":

        EPS = int(input("EPS: "))
        SciencePC = int(input("SciencePC: "))
        ScienceSVT = int(input("ScienceSVT: "))
        PhysiqueChimie = int(input("PhysiqueChimie: "))
        Francais = int(input("Francais: "))
        Allemand = int(input("Allemand: "))
        Anglais = int(input("Anglais: "))
        AnglaisLitt = int(input("AnglaisLitt: "))
        HistoireGéographie = int(input("HistoireGéographie: "))
        EMC = int(input("EMC: "))
        Mathématiques = int(input("Mathématiques: "))

        matières = [EPS, SciencePC, ScienceSVT, PhysiqueChimie, Francais, Allemand, Anglais, AnglaisLitt, HistoireGéographie, EMC, Mathématiques]

        sumOf = sum(matières)

        print(sumOf)

        average = sumOf/11 #This number (11) would then be changed to a variable

        print("\nTa moyenne est de: " + str(average))

        save = input("\nVeut tu sauvegarder cette moyenne comme ta nouvelle moyenne? (y/*): ")

        if save == "y":
            print("\nsaving value: " + str(average) + " as new value...")
            file2write = open("currentValue", 'w')
            file2write.write(str(average))
            file2write.close()
            print("succesfully saved!")
            Calc()

```

BTW : There is some text in french as you certainly noticed

Answer: 
keeping everything in lists, you can use a loop and try block to skip empty input.

```
   elif whatDo == "2":

        matières_strings = ["EPS", "SciencePC", "ScienceSVT", "PhysiqueChimie", "Francais", "Allemand", "Anglais", "AnglaisLitt", "HistoireGéographie", "EMC", "Mathématiques"]

        matières = []
        for s in matières_strings:
            input_string = input("{}: ".format(s))

            try:
                val = int(input_string) ## if the user inputs nothing, casting to int will fail
                                        ## and will exit the try block, thus no value will be appended to the list
                matières.append(val)
            except ValueError:
                pass

        sumOf = sum(matières)

        print(sumOf)

        average = sumOf/len(matières) 

        print("\nTa moyenne est de: " + str(average))

        save = input("\nVeut tu sauvegarder cette moyenne comme ta nouvelle moyenne? (y/*): ")

        if save == "y":
            print("\nsaving value: " + str(average) + " as new value...")
            file2write = open("currentValue", 'w')
            file2write.write(str(average))
            file2write.close()
            print("succesfully saved!")
            Calc()

```
I would use a different variable as my divisor. Then you could count the number of inputs that aren't '0' using a list comprehension and assign it to that variable.

```
matières = [EPS, SciencePC, ScienceSVT, PhysiqueChimie, Francais, Allemand, Anglais, AnglaisLitt, HistoireGéographie, EMC, Mathématiques]

sumOf = sum(matières)

print(sumOf)

nonZero = [i for i in matières if i != 0]
numberOf = len(nonZero)

average = sumOf/numberOf 

```