Question

    Predict the output for below code in python

    Count =10

    Def function1() :

    Global Count

    for i in(1,2,3) :

    Count=Count+1

    function1()

    print(Count)

    A 13 Correct Answer Incorrect Answer
    B 6 Correct Answer Incorrect Answer
    C 16 Correct Answer Incorrect Answer
    D 5 Correct Answer Incorrect Answer
    E error Correct Answer Incorrect Answer

    Solution

    The variable Count is the same that is defined outside and inside the function , so the changes will be reflected to the same variable.

    Practice Next
    ×
    ×