From d202fea352a7fcb3e528a2e605df4082d4c8e3af Mon Sep 17 00:00:00 2001 From: Crista Lopes Date: Mon, 12 Aug 2019 20:15:33 -0700 Subject: [PATCH] Format to fit in 1 page --- 03-arrays/tf-03.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/03-arrays/tf-03.py b/03-arrays/tf-03.py index 130f216..e220035 100644 --- a/03-arrays/tf-03.py +++ b/03-arrays/tf-03.py @@ -1,25 +1,24 @@ import sys, string import numpy as np -# Get an array of characters from the file, make sure it starts and ends with a space -# Example input: "Hello World! " -characters = np.array([' '] + list(open(sys.argv[1]).read()) + [' ']) +# Example input: "Hello World!!" +characters = np.array([' ']+list(open(sys.argv[1]).read())+[' ']) # Result: array([' ', 'H', 'e', 'l', 'l', 'o', ' ', ' ', -# 'W', 'o', 'r', 'l', 'd', '!', ' ', ' '], dtype=' 1] # Result: [array([' ', 'h', 'e', 'l', 'l', 'o'], dtype='