Advertisement
arch-toto

pytest

Mar 7th, 2021
910
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. >>> input.close()
  2. >>> input = open("txt.txt")
  3. >>> for line in input:
  4. ...     lista.append(line)
  5. ...
  6. >>> print(lista)
  7. ['why am i so tired\n', 'i must need caffeine\n', 'there must be something missing in my life\n', 'what ever could it be\n']
  8. >>> lista.clear()
  9. >>> print(lista)
  10. []
  11. >>> for line in input:
  12. ...     lista.append(line)
  13. ...
  14. >>> print(lista)
  15. []
  16. >>> lista.append("pedro")
  17. >>> for line in input:
  18. ...     lista.append(line)
  19. ...
  20. >>> print(lista)
  21. ['pedro']
  22. >>>
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement