timesguessed = 0
guessedletters = 
choiceword = 
correctguess = 
def getfile(): #Function1_Puts all words from file into a list
getfile = open("words.txt", 'r')
line = getfile.readline()
words = string.spli
The key idea of this program is to equate the strings
"rock", "paper", "scissors", "lizard", "Spock" to numbers
games_won = 0
Computer Science Test Review
November 3, 2014
Functions: Be able to define and call functions, including functions with up to two parameters
and passing arguments to functions.
How to use return statements in a function and what will happen if you dont ha
3 native collections in python:
lists, tuples, dictionaries
Dictionary is an example of a hashmap.
Its a nonsequential collection
We dont need to use an index to keep track
of the elements.
Instead, a dictionary maps two things to
Computer Science Assignment for 10/16:
Write two programs:
1. A program that takes a string as input and prints out the number of vowels.
2. A program that takes in a string and prints out the number of times the string bob occurs.
1. Make a MODULE that a person can import and use functions from
2. Make a DICTIONARY, any dictionary you want
3. Using pickle, create a dictionary or list that can be written to file and pulled back in
4. Create a quad form function that uses try/except
word=raw_input("Enter a string with vowels in it. ").lower()
for i in range(0,len(word):
if word[i]="a"or word[i]="e" or word[i]="i" or word[i]="o" or
print "There was one vowel in your s
if num >=64:
elif num <=63: