diff --git a/Chapter_10/10-01_learning_python.py b/Chapter_10/10-01_learning_python.py new file mode 100644 index 0000000..48b3dea --- /dev/null +++ b/Chapter_10/10-01_learning_python.py @@ -0,0 +1,15 @@ +# Exercise 10-1 Learning Python +# Learning Objective: Read from a text file + +from pathlib import Path + +path = Path('Chapter_10/learning_python.txt') +contents = path.read_text() + +print(contents) + +lines = contents.splitlines() + +for line in lines: + print(line) + diff --git a/Chapter_10/learning_python.txt b/Chapter_10/learning_python.txt new file mode 100644 index 0000000..dac5c3c --- /dev/null +++ b/Chapter_10/learning_python.txt @@ -0,0 +1,4 @@ +In Python you can assign variables +In Python you can do math +In Python you can create loops +In Python you can use if statements \ No newline at end of file