Sign in to follow this  
Kiryn

Python: Questions about Python

Recommended Posts

I have a few questions while learning Python. 1. How would I make a variable private? 2. How can I make a readonly variable? a Write only variable? 3. Wheres a list of all these __x__ located so I can know how to use everyone of just know what they mean and do? These are all I can think of so far.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kiryn
1. How would I make a variable private?
2. How can I make a readonly variable? a Write only variable?
3. Wheres a list of all these __x__ located so I can know how
to use everyone of just know what they mean and do?


Generally Python programmers don't want to make variables private. You can probably achieve your readonly/writeonly needs using properties, though they're not all that common either.

Note also that TStrimp has linked you to very old Python docs. Look up the equivalents in the newer docs before going on what you read there.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this