+ 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 Respuestas
+ 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