Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- searching_for = 'abc'
- found = False
- with open('/etc/passwd') as f:
- for line in f:
- username = line.split(':')[1]
- if username == searching_for:
- found = True
- break
- if found == 'True'
- print('found')
- else:
- print('not found')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement