Python 2.3.4 (#2, Dec 3 2004, 13:53:17) \n[GCC 3.3.5 (Debian 1:3.3.5-2)] on linux2\nType "help", "copyright", "credits" or "license" for more information.\n>>> import dice\n>>> dice.rolldice(4)\n[4, [4, 2, 2]]\n
What version of Python?
Incidentally, please do yourself and other future programmers who might have to look at your code, and put some whitespace around your operators:
import random\nrandom.seed()\n\ndef rolldice(numdice):\n result = 0\n rolls = []\n for n in range(1, numdice):\n roll = random.randint(1, 6)\n rolls.append(roll)\n if result < roll:\n result = roll\n elif roll == 6:\n result += 1\n return [result, rolls]
This has been a PSA (programming style analism).