Posts by Daniel Chaves • 223 points
2 posts
-
3
votes2
answers5642
viewsQ: How to access variables present in different functions?
What is the best way to access a variable that was created in a function? For example: def Luggage(): mala = [] take = raw_input("O que você deseja levar na sua viagem?") mala.append(take) In case I…
-
19
votes1
answer25589
viewsQ: When should I use __init__ in functions within classes?
For the book I am studying, in some moments the author uses __init__ as a first function of a class. This function (and others) always has self as one of the variables (something I haven’t yet…