Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. fList = {7:7, 9:9}
  2.  
  3. def checkList():
  4. if not None in fList:
  5. print(fList)
  6. fL = random.choice(fList)
  7. ttt[fL] = computerLetter
  8. del fList[fL]
  9. print(fL)
  10. print(ttt)
  11. print(fList)
  12.  
  13. {9: 9, 7: 7}
  14. Traceback (most recent call last):
  15. File "/home/jason/Desktop/Programming/Python3_5/TestCode.py", line 35, in <module>
  16. checkList()
  17. File "/home/jason/Desktop/Programming/Python3_5/TestCode.py", line 22, in checkList
  18. fL = random.choice(fList)
  19. File "/usr/lib/python3.5/random.py", line 265, in choice
  20. return seq[i]
  21. KeyError: 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement