1
2
3
4
5
6
import getpass
password = getpass.getpass('Pass: ')
if password == '1234':
  print('Ok!')
elif password != '1234':
  print('Problem :( ')
Python 3.6.1 (default, Dec 2015, 13:05:11) [GCC 4.8.2] on linux