Putting #'s and variables together in 1 variable

2007-08-23 Thread Lamonte Harris
File Desktop\python\newsystem\init.py, line 51, in random_n random_name = a+b+c+d+e+ 'temp.txt' TypeError: unsupported operand type(s) for +: 'int' and 'str' import random def random_name(): a = random.randint(0,9) b = random.randint(0,9) c = random.randint(0,9) d =

Re: Putting #'s and variables together in 1 variable

2007-08-23 Thread Jay Loden
Lamonte Harris wrote: File Desktop\python\newsystem\init.py, line 51, in random_n random_name = a+b+c+d+e+ 'temp.txt' TypeError: unsupported operand type(s) for +: 'int' and 'str' import random def random_name(): a = random.randint(0,9) b = random.randint(0,9) c =

Re: Putting #'s and variables together in 1 variable

2007-08-23 Thread Grant Edwards
On 2007-08-23, Jay Loden [EMAIL PROTECTED] wrote: 2) Since all you're doing is adding a bunch of numeric values to each other to build the string, why wouldn't you just create a random number between 0 - 9 and use that? Since the OP calls randint 5 times, his answer is 5 times more

Re: Putting #'s and variables together in 1 variable

2007-08-23 Thread Steve Holden
Lamonte Harris wrote: File Desktop\python\newsystem\init.py, line 51, in random_n random_name = a+b+c+d+e+ 'temp.txt' TypeError: unsupported operand type(s) for +: 'int' and 'str' import random def random_name(): a = random.randint(0,9) b = random.randint(0,9) c =