Thank you guys
On Thu, Nov 6, 2014 at 3:39 AM, Dave Angel wrote:
> William Becerra Wrote in message:
> >
>
> have the following code:
> names = "John, Cindy, Peter"
> def find(str, ch, s):
> index = 0
> while index < len(str):
> if s==1:
> for char in names[:4]:
>
William Becerra Wrote in message:
>
have the following code:
names = "John, Cindy, Peter"
def find(str, ch, s):
index = 0
while index < len(str):
if s==1:
for char in names[:4]:
if str[index] == ch:
return index + 1
William Becerra wrote:
> Hey, I'm new to programming
> running Python 2.7.8 Windows 8.1
> I was reading 'How to Think Like a Computer Scientist- Learning with
> Python' chapter 7 sub-chapter 7.7
>
> I have the following code:
> names = "John, Cindy, Peter"
> def find(str, ch, s):
> index = 0
On 05/11/14 13:19, William Becerra wrote:
names = "John, Cindy, Peter"
def find(str, ch, s):
index = 0
while index < len(str):
if s==1:
for char in names[:4]:
if str[index] == ch:
return index + 1
index = inde
Hey, I'm new to programming
running Python 2.7.8 Windows 8.1
I was reading 'How to Think Like a Computer Scientist- Learning with Python'
chapter 7 sub-chapter 7.7
I have the following code:
names = "John, Cindy, Peter"
def find(str, ch, s):
index = 0
while index < len(str):
if s==
On Tue, Oct 23, 2012 at 7:48 PM, Alexander wrote:
> On Tue, Oct 23, 2012 at 7:24 PM, Nitin Ainani wrote:
>> Dear Sir/Madam,
>>
>> I am new to python I have a question. It is as follows:
>>
>> Suppose s is a variable and s stores empty string
>>
>> emptyString = ""
> #consider the string to be no
On 24/10/2012 00:24, Nitin Ainani wrote:
Dear Sir/Madam,
I am new to python I have a question. It is as follows:
Suppose *s* is a variable and *s* stores empty string
Pythonistas prefer the use of name and not variable.
s=""
Now if we write following statement
print(s[0]) # it give
On 10/23/2012 07:48 PM, Alexander wrote:
> On Tue, Oct 23, 2012 at 7:24 PM, Nitin Ainani wrote:
>> Dear Sir/Madam,
>>
>> I am new to python I have a question. It is as follows:
>>
>> Suppose s is a variable and s stores empty string
>>
>> emptyString = ""
> #consider the string to be non-empty, t
On Tue, Oct 23, 2012 at 7:24 PM, Nitin Ainani wrote:
> Dear Sir/Madam,
>
> I am new to python I have a question. It is as follows:
>
> Suppose s is a variable and s stores empty string
>
> emptyString = ""
#consider the string to be non-empty, that is, let's say 13 characters
long (the number you
Dear Sir/Madam,
I am new to python I have a question. It is as follows:
Suppose *s* is a variable and *s* stores empty string
s=""
Now if we write following statement
print(s[0]) # it gives error
print(s[0:])# it does not give error
print (s[13:13]) # this too does not give erro
On Wed, Sep 16, 2009 at 10:33 AM, Jojo Mwebaze wrote:
> Hello There Again
>
> Might be a silly question but it has played me for the last two days!
>
> I have a string 'mystring' (pasted below), what i want to do is to change
> the values of of NAXIS1 (=1024) and NAXIS2 (=2048) to some other va
Hello There Again
Might be a silly question but it has played me for the last two days!
I have a string 'mystring' (pasted below), what i want to do is to change
the values of of NAXIS1 (=1024) and NAXIS2 (=2048) to some other values!
say NAXIS1 = 999 and NAXIS2 = 888.
These old values that i
[ wish to make a dictionary of english to czech words / Unsupported
characters in input / ISO-8859-2 ]
have a look at the manual, in my case, section 4.9.2 on stand
encodings p. 149 of the 2.4.3 (lib.pdf) Python Library Reference and
at the python prompt try
>>> help('modules codecs')
-- vy
___
On Sat, May 23, 2009 at 11:31 PM, Leon Williams wrote:
> Hello,
>
> I wish to make a dictionary of english to czech words. I thought I would
> first see if python will print a czech character. I used the example in the
> tutorial (it uses a euro symbol, and a different iso character set so I
> c
Hello,
I wish to make a dictionary of english to czech words. I thought I would first
see if python will print a czech character. I used the example in the tutorial
(it uses a euro symbol, and a different iso character set so I changed mine to
include a character set that includes eastern eu
On Thu, Jan 15, 2009 at 1:14 AM, Mr Gerard Kelly
wrote:
> If you have a string "6", and you do int("6"), you get the number 6.
>
> But if you have a string "2*3" and you do int("2*3") you get a name error.
>
> How do you take an expression in a string, and evaluate the expression
> to get a number
> If you have a string "6", and you do int("6"), you get the number 6.
> But if you have a string "2*3" and you do int("2*3") you get a name error.
the reason you get this error is because "2*3" is not a string
representation of an integer whereas "6" is. in other words 2*3 is not
a number.
> Ho
Try eval("2*3")
On Thu, 2009-01-15 at 10:14 +1000, Mr Gerard Kelly wrote:
> If you have a string "6", and you do int("6"), you get the number 6.
>
> But if you have a string "2*3" and you do int("2*3") you get a name error.
>
> How do you take an expression in a string, and evaluate the expressi
If you have a string "6", and you do int("6"), you get the number 6.
But if you have a string "2*3" and you do int("2*3") you get a name error.
How do you take an expression in a string, and evaluate the expression
to get a number?
I want to be able to turn the string "2*3" into the number 6.
t
Liam Clarke wrote:
> Hi,
>
> Thanks Kent, I'll check out the CSV module. I had a go with Pyparsing
> awhile ago, and it's clocking in at the 3 minute mark also.
>
> Alan - the data is of the form -
>
> a = {
> b = 1
> c = 2
> d = { e = { f = 4 g = "Ultimate Showdown of Ultimate Destiny" } h =
Liam wrote:
Alan - the data is of the form -
a = {
b = 1
c = 2
d = { e = { f = 4 g = "Ultimate Showdown of Ultimate Destiny" } h =
{ i j k } }
}
Everything is whitespace delimited. I'd like to turn it into
["a", "=", "{", "b", "=", "1",
"c", "=", "2", "d", "=", "{",
6, Alan Gauld <[EMAIL PROTECTED]> wrote:
> Hi Liam,
>
> I'm not sure I really understand what you are trying
> to get to here.
>
> Can you provide a short sample of before/after data
> so we can see what we are trying to achieve?
>
> Alan G
>
> - Or
on Tutor"
Sent: Wednesday, January 25, 2006 1:18 PM
Subject: [Tutor] strings & splitting
Hi all,
I have a large string which I'm attempting to manipulate, which I find
very convenient to call
large_string.split(" ") on to conveniently tokenise.
Except, however for the dou
Liam Clarke wrote:
> Hi all,
>
> I have a large string which I'm attempting to manipulate, which I find
> very convenient to call
> large_string.split(" ") on to conveniently tokenise.
>
> Except, however for the double quoted strings within my string, which
> contain spaces.
>
> At the moment I
Hi all,
I have a large string which I'm attempting to manipulate, which I find
very convenient to call
large_string.split(" ") on to conveniently tokenise.
Except, however for the double quoted strings within my string, which
contain spaces.
At the moment I'm doing a split by \n, and then loopin
On Thu, 19 Jan 2006, Hans Dushanthakumar wrote:
> Try this:
>
> print word[::-1]
Hi Hans and Adam,
Just wanted to point out: next time, let's try to figure out why Ryan had
problems with this, rather than directly give a working answer.
For example, we can ask things like: what part did Ryan
On 18/01/06, ryan luna <[EMAIL PROTECTED]> wrote:
--- Adam <[EMAIL PROTECTED]> wrote:> On 18/01/06, ryan luna <[EMAIL PROTECTED]>> wrote:
> >> > Hello, what i need to do is get user input and> then> > print the string backwards ^^ i have no idea how> to do> > that,> >> > print "Enter a word and i w
Try this:
print word[::-1]
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of ryan luna
Sent: Thursday, 19 January 2006 12:13 p.m.
To: tutor@python.org
Subject: [Tutor] Strings backwards
Hello, what i need to do is get user input and then print the string
Hello, what i need to do is get user input and then
print the string backwards ^^ i have no idea how to do
that,
print "Enter a word and i well tell you how to say it
backwards"
word = raw_input("Your word: ")
print word
all that is simple enough im sure printing it out
backwards is to, just d
29 matches
Mail list logo