"Shurui Liu (Aaron Liu)" wrote
In Python, could space be counted as a character same as a letter?
In Python the fastest and most certain way to answer such
questions is to try it at the >>> prompt.
len('ab cd') # is it 4 or 5?
5
HTH,
--
Alan Gauld
Author of the Learn to Program web
yeah, thank you!
On Wed, Mar 31, 2010 at 1:41 AM, Christian Witts wrote:
> Shurui Liu (Aaron Liu) wrote:
>>
>> In Python, could space be counted as a character same as a letter?
>>
>>
>
> len(...)
> len(object) -> integer
> Return the number of items of a sequence or mapping.
>
> As a space
Shurui Liu (Aaron Liu) wrote:
In Python, could space be counted as a character same as a letter?
len(...)
len(object) -> integer
Return the number of items of a sequence or mapping.
As a space is an item it will be counted.
--
Kind Regards,
Christian Witts
_
In Python, could space be counted as a character same as a letter?
--
Shurui Liu (Aaron Liu)
Computer Science & Engineering Technology
University of Toledo
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mai
"Gigs_" <[EMAIL PROTECTED]> wrote in message
> here is the code:
So where do you think you tell Python that you are
using unicode strings?
I'm no expert but I think, as a minimum you need:
for i in S:
S = S.replace(u'æ', u'ć')
S = S.replace(u'è', u'č')
S = S.replace(u'ð', u'đ')
You might
Hugo Gonzalez M wrote:
> >> I tried with unicode strings, but nothing. It says : unsoported
> characters
> >>
>
> They are supported. Are you using them literally in your code? Anything
> other than ASCII or Latin-1 needs to be declared explicitly at the start
> of the source code file.
>
> Ma
>> I tried with unicode strings, but nothing. It says : unsoported
characters
>>
They are supported. Are you using them literally in your code? Anything
other than ASCII or Latin-1 needs to be declared explicitly at the start
of the source code file.
Maybe you can use UTF-8 encoding.
See:
here is the code:
def changer():
"""Changer from Serbian to Croatian for this letters: æ, è, ð in ć, č, đ
"""
whatfile = raw_input('Enter location of your file: ')
# open and read file
ofile = open(whatfile, 'r')
S = ofile.read()
ofile.close()
# search file and replace æ, è in ć, č
for i in S:
S
Stanko wrote:
> I tried with unicode strings, but nothing. It says : unsoported characters
>
Perhaps you could give us the code you were using?
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
I tried with unicode strings, but nothing. It says : unsoported characters
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Stanko wrote:
> Can python handle this characters: ć, č, š, đ, ž?
> If can, How?
>
Unicode strings.
> And how to change tab spaceing in idle? I tried in idle properties. I
> have set it to 4 character but it's still 8.
>
The default is 4.
If it's 8, find out who changed it and ask them to ch
Can python handle this characters: ć, č, š, đ, ž?
If can, How?
And how to change tab spaceing in idle? I tried in idle properties. I
have set it to 4 character but it's still 8.
Thanks!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mai
12 matches
Mail list logo