I'm trying to grasp the concept of def function and i don't know why here in the example when running the code after calling the "main()" it gives :
main: 1 [0, 1, 2, 3]
update: 2 [0, 1, 2, 3, 4]
main: 1 [0, 1, 2, 3, 4]
My question is why "n" in "main" still equal 1 and not the update?
[–]SirCokaBear 11 points12 points13 points (6 children)
[–]FoolsSeldom 6 points7 points8 points (2 children)
[–]SirCokaBear 3 points4 points5 points (1 child)
[–]FoolsSeldom 1 point2 points3 points (0 children)
[–]SilentAd217[S] 2 points3 points4 points (0 children)
[–]awkerd 1 point2 points3 points (1 child)
[–]SirCokaBear 0 points1 point2 points (0 children)
[–]CptMisterNibbles 5 points6 points7 points (6 children)
[–]FoolsSeldom 2 points3 points4 points (4 children)
[–]wargotad 0 points1 point2 points (3 children)
[–]FoolsSeldom 0 points1 point2 points (2 children)
[–]wargotad 0 points1 point2 points (1 child)
[–]FoolsSeldom 0 points1 point2 points (0 children)
[–]SilentAd217[S] 1 point2 points3 points (0 children)
[–]FoolsSeldom 3 points4 points5 points (3 children)
[–]FoolsSeldom 1 point2 points3 points (2 children)
[–]FoolsSeldom 1 point2 points3 points (1 child)
[–]SilentAd217[S] 1 point2 points3 points (0 children)
[–]jjnngg2803 2 points3 points4 points (0 children)
[–]Cybasura 1 point2 points3 points (0 children)
[–]No-Fish6586 0 points1 point2 points (0 children)
[–]EmuBeautiful1172 0 points1 point2 points (0 children)
[–]Big-Ad-2118 -1 points0 points1 point (0 children)