Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 12th, 2011  |  syntax: None  |  size: 0.83 KB  |  hits: 82  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def main():
  2.     """Stored List"""
  3.     correctAnswers = ['B','D','A','A','C','A','B','A','C','D','B','C','D','A','D','C','C','B','D','A']
  4.     """Wrong answers"""
  5.     wrong= []
  6.     """Input file"""
  7.     fileName = input("Enter the test file to grade: ")
  8.     infile = open(fileName, 'r')
  9.     wordlist = list(infile.readline())
  10.    
  11.     print (wordlist)
  12.    
  13.     """Comparing List"""
  14.     for x in wordlist:
  15.         if wordlist[x]== correctAnswers[x]:
  16.             numCorrect = 0
  17.             numCorrect +=1
  18.         else:
  19.             numWrong = 0
  20.             numWrong +=1
  21.             list.append[x]
  22.  
  23.         if correctAnswers >= 15:
  24.             print ("Passed!")
  25.         else:
  26.             print ("Failed!")
  27.  
  28.         print (correctAnswers)
  29.         print (wrong)
  30.         while x <len(wrong):
  31.             print ("incorrect")
  32.  
  33. main()