Created
April 18, 2019 17:34
-
-
Save luisenriquecorona/100d223916cbf7e0fdd4d9d89d4e0357 to your computer and use it in GitHub Desktop.
Test text Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> f = open('data.txt') >>> text = f.read() | |
>>> text 'Hello\nworld\n' | |
>>> print(text) Hello | |
world | |
>>> text.split() ['Hello', 'world'] | |
# 'r' (read) is the default processing mode # Read entire file into a string | |
# print interprets control characters | |
# File content is always a string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run Code Python 3.3
Python (command line)
C:\code> python Helloword.py
View
Hello world