Showing posts with label list. Show all posts
Showing posts with label list. Show all posts

Thursday, April 23, 2015

Writing to a text file

The following program write three lines and creates a text file. The writelines method can be used to write lines from a list to a text file.






Friday, February 13, 2015

Hangman Game

The following program is a simple hangman game. It utilizes lists and tuples.




Tuesday, November 25, 2014

Unpacking a List


Word Frequency Counter

This program makes a count of the words on a webpage. The basic outline of the program is as follows:

(1) Use Beautiful Soup to  crawl a webpage.
(2) Put words from webpage into list.
(3) Pass this word list into a method that cleans up word list.
(4) Pass this clean word list into method that creates a dictionary with key of word and value of number of times word occurs.

See program below: