Skip to content
CodeKruPro

Changing a global with the global keyword

Predict the outputEasyPython onlyAsked in: TCS
main.py
count = 0

def inc():
    global count
    count += 1

inc()
inc()
print(count)

Graded by exact match. Spaces at the ends of lines and blank lines at the end do not count.

to answer and keep your progress. Reading is free for everyone.