+ 1
How can i call a function in another function ?
def l(): print("x") def j(): print("5") how can i call l in j?
2 Answers
+ 2
def l():
print("x")
def j():
l()
print("5")
j()
+ 5
Calling a function from another function is done the same way as you would with just calling the function normally, so in this case you'd just need to add in the line l() somewhere within j and you should be good (but just remember to call j as otherwise it won't run)