0
Function arguments
hey guys, i have got a little problem with this part of a code: it has to change the default value of an argument of a function https://code.sololearn.com/cNNkMA0asY22/?ref=app the commented part doesn't work, instead the code below run correctly is it an 'elegant' solution? is there a better way to make this code run correctly?
2 odpowiedzi
0
if it is a global variable why pass it?
globalVal = 2
def f():
val=globalVal
print(val)
f()
globalVal = 7
f()
0
you're right hahah, i wrote it on my laptop and i report here and i was wrong while i was copying @Kedar Kale