+ 1

How to get a var change from function in python?

For example: def ho(y): y =y+3 return y def hoho(): y=5 ho(y) print(y) hoho() >>5 Why not 8? How to get 8 in this type of code?

24th Dec 2021, 7:01 AM
ŠŠ°Ń‚Š°Š»ŃŒŃ ŠŠ±Š°ŠøŠ¼Š¾Š²Š°
ŠŠ°Ń‚Š°Š»ŃŒŃ ŠŠ±Š°ŠøŠ¼Š¾Š²Š° - avatar
2 Answers
+ 6
After y=5 please change to y=ho(y)
24th Dec 2021, 7:24 AM
Oma Falk
Oma Falk - avatar
+ 1
Thank you! šŸ˜€
24th Dec 2021, 7:32 AM
ŠŠ°Ń‚Š°Š»ŃŒŃ ŠŠ±Š°ŠøŠ¼Š¾Š²Š°
ŠŠ°Ń‚Š°Š»ŃŒŃ ŠŠ±Š°ŠøŠ¼Š¾Š²Š° - avatar