Re: Weird Python Bug

2019-09-13 Thread MRAB
On 2019-09-13 20:17, CrazyVideoGamez wrote: For some reason, if you put in the code def odd_ones_out(numbers): for num in numbers: count = numbers.count(num) if not count % 2 == 0: for i in range(count): numbers.remove(num) return

RE: Weird Python Bug

2019-09-13 Thread David Raymond
2, 67, 67] >>> odd_ones_out(nums) [4, 67, 67] >>> nums [4, 67, 67] >>> -Original Message- From: Python-list On Behalf Of CrazyVideoGamez Sent: Friday, September 13, 2019 3:18 PM To: python-list@python.org Subject: Weird Python Bug For some reason, if you put i

Weird Python Bug

2019-09-13 Thread CrazyVideoGamez
For some reason, if you put in the code def odd_ones_out(numbers): for num in numbers: count = numbers.count(num) if not count % 2 == 0: for i in range(count): numbers.remove(num) return numbers nums = [72, 4, 82, 67, 67]

Re: very weird python bug..

2009-09-28 Thread Sampsa Riikonen
On Thursday 24 September 2009 02:01:52 pm Christian Heimes wrote: Sampsa Riikonen wrote: = If I start the program in directory paska2, everythings OK, but if the directory name happens to be python, the importation of the modules goes nuts! What's inside the python/ subdirectory? Do you

very weird python bug..

2009-09-24 Thread Sampsa Riikonen
Dear List, Maybe someone could help out with this mysterious bug.. starting a python program in a directory named python, makes the importation of modules sometimes impossible with cryptic error messages.. sam...@linux-912g:~ mkdir paska2 sam...@linux-912g:~ sam...@linux-912g:~ echo import

Re: very weird python bug..

2009-09-24 Thread Christian Heimes
Sampsa Riikonen wrote: = If I start the program in directory paska2, everythings OK, but if the directory name happens to be python, the importation of the modules goes nuts! What's inside the python/ subdirectory? Do you happen to have a file called struct.py inside it? --