Hi there,
I have a string in which I want to calculate how often the character ';'
occurs. If the character does not occur 42 times, the ; should be added so
the 42 are reached.
My solution is slow and wrong:
for Position in range (0, len(Zeile)):
if Zeile[Position]==';':
On Wed, 2005-12-21 at 09:03, P. Schmidt-Volkmar wrote:
Hi there,
I have a string in which I want to calculate how often the character ';'
occurs. If the character does not occur 42 times, the ; should be added so
the 42 are reached.
My solution is slow and wrong:
for Position in
should = 42
has = Zeile.count(';')
if has should:
Zeile += ;*(should - has)
cheers, claude
--
http://mail.python.org/mailman/listinfo/python-list
Il 2005-12-21, P. Schmidt-Volkmar [EMAIL PROTECTED] ha scritto:
Hi there,
I have a string in which I want to calculate how often the character ';'
occurs. If the character does not occur 42 times, the ; should be added so
the 42 are reached.
My solution is slow and wrong:
for
P. Schmidt-Volkmar wrote:
Hi there,
I have a string in which I want to calculate how often the character ';'
occurs. If the character does not occur 42 times, the ; should be added so
the 42 are reached.
My solution is slow and wrong:
How can this be achieved easily?
Is this
P. Schmidt-Volkmar [EMAIL PROTECTED] writes:
Hi there,
I have a string in which I want to calculate how often the character ';'
occurs. If the character does not occur 42 times, the ; should be added so
the 42 are reached.
My solution is slow and wrong:
for Position in range (0,
Ove Svensson [EMAIL PROTECTED] writes:
P. Schmidt-Volkmar [EMAIL PROTECTED] writes:
Hi there,
I have a string in which I want to calculate how often the character ';'
occurs. If the character does not occur 42 times, the ; should be added
so
the 42 are reached.
My
On 21 Dec 2005 15:57:35 +0100, Ove Svensson [EMAIL PROTECTED] wrote:
Ove Svensson [EMAIL PROTECTED] writes:
P. Schmidt-Volkmar [EMAIL PROTECTED] writes:
Hi there,
I have a string in which I want to calculate how often the character ';'
occurs. If the character does not occur 42