Advertisement
apez1

Untitled

Sep 30th, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. # lab9.py
  2. # Alexander Perez
  3. # Lab Section M5
  4.  
  5.  
  6. def main():
  7.  
  8.  
  9.     # uInput = input("What is the name of the input file?")
  10.     #
  11.     # infile = open(uInput,"r")
  12.     #
  13.     # sum = 0
  14.     #
  15.     # for line in infile:
  16.     #
  17.     #     #print(line)        # debug
  18.     #     test = line.split()
  19.     #     #print(test)         # debug
  20.     #
  21.     #     for words in test:
  22.     #         print(len(words),end=" ")
  23.     #         sum += len(words)
  24.     #
  25.     #
  26.     #     print(len(test))   # Debug
  27.     #
  28.     #     print(line,sum/len(test))
  29.     #     sum = 0
  30.     #
  31.     #
  32.     # infile.close()
  33.  
  34.  
  35.     uInput = input("What is the name of the Input file?")
  36.  
  37.     infile = open(uInput,"r")
  38.  
  39.     contents = infile.readlines()
  40.  
  41.     newList = []
  42.  
  43.     for lines in contents:
  44.         newList += lines.split('\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement