Advertisement
Guest User

Untitled

a guest
May 12th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. ...
  2. searching_for = 'abc'
  3.  
  4. found = False
  5.  
  6. with open('/etc/passwd') as f:
  7. for line in f:
  8. username = line.split(':')[1]
  9. if username == searching_for:
  10. found = True
  11. break
  12.  
  13. if found == 'True'
  14. print('found')
  15. else:
  16. print('not found')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement