I hate storing plaintext passwords anywhere. If it's just for you, sure, go right ahead, but once you move to doing "real" applications, using databases and storing *other peoples* info, please use a more secure method. Like a one-way hashing algorithm. For example:
>>> import hashlib
>>> hashlib.sha512('180423'.encode()).hexdigest()
'0b6c4a35b8cfb237fb16e3773cba0a65dd6af67de14f16450e857517a524f46199644add78adc3a966517ea22d7c1cc99dd716db26668b32a4e9d10b5573dc1a'
That big string is what you'd store, so your actual password isn't anywhere in your script. Then, when you get the user's password (via getpass or rawinput), you hash it, and compare the hash with what you previously computed.
That way, even if someone gets smart, they can't open up your script and read the password... (though they can re-write it, or put a different hash in there).