Completed Exercise 10-1 Learning Python

This commit is contained in:
cheeks 2025-03-03 17:07:02 +00:00
parent b4835be881
commit ee9b99e138
2 changed files with 19 additions and 0 deletions

View File

@ -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)

View File

@ -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