I am trying to learn how to use strip() method. It is supposed to cut out
all the whitespace as I read in the tutorial. But the code is not working.
Here's my code:
sentence = "Hello, how are you?"
>
>
>> print(sentence)
>
>
>> print(sentence.strip())
>
>
>> input("\n\nPress enter key to exit.")
On 07/03/15 13:15, Akash Shekhar wrote:
I am trying to learn how to use strip() method. It is supposed to cut out
all the whitespace as I read in the tutorial.
Read it again more closely.
---
Help on built-in function strip:
strip(...)
S.strip([chars]) -> string or unicode
On 03/07/2015 08:15 AM, Akash Shekhar wrote:
I am trying to learn how to use strip() method. It is supposed to cut out
all the whitespace as I read in the tutorial. But the code is not working.
Here's my code:
sentence = "Hello, how are you?"
print(sentence)
print(sentence.strip())
On 07/03/2015 14:54, Alan Gauld wrote:
On 07/03/15 13:15, Akash Shekhar wrote:
I am trying to learn how to use strip() method. It is supposed to cut out
all the whitespace as I read in the tutorial.
Read it again more closely.
---
Help on built-in function strip:
strip(...)
On 07/03/15 15:17, Mark Lawrence wrote:
S.strip([chars]) -> string or unicode
Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is unicode, S will be converted to unic
hello , I would like to know if theres a way to change a variable's name
after every iteration for example I want to make a function that stores a
number in x_1 if i=1 and in x_2 if i=2.
To be more precise:
i=1
def f(n):
while ihttps://mail.python.org/mailman/listinfo/tutor
On Sat, Mar 7, 2015 at 10:39 AM, elie khairallah
wrote:
> hello , I would like to know if theres a way to change a variable's name
> after every iteration for example I want to make a function that stores a
> number in x_1 if i=1 and in x_2 if i=2.
> To be more precise:
> i=1
> def f(n):
>
On 07/03/2015 15:39, elie khairallah wrote:
hello , I would like to know if theres a way to change a variable's name
after every iteration for example I want to make a function that stores a
number in x_1 if i=1 and in x_2 if i=2.
To be more precise:
i=1
def f(n):
while i
Why bother? Wh
On Sat, Mar 7, 2015 at 1:28 PM, Danny Yoo wrote:
>> You could certainly use I as an index into a list called x. This
>> doesn't look like a good idea though
>
>
> Can you explain more what's problematic with a list?
>
> My best understanding so far of the problem is that the original
> questioner
On Sat, Mar 7, 2015 at 7:39 AM, elie khairallah
wrote:
> hello , I would like to know if theres a way to change a variable's name
> after every iteration for example I want to make a function that stores a
> number in x_1 if i=1 and in x_2 if i=2.
Conceptually, I think you're looking for a list.
> You could certainly use I as an index into a list called x. This
> doesn't look like a good idea though
Can you explain more what's problematic with a list?
My best understanding so far of the problem is that the original
questioner is trying to compute a tabulation of results. For example,
On 07/03/15 15:39, elie khairallah wrote:
hello , I would like to know if theres a way to change a variable's name
after every iteration for example I want to make a function that stores a
number in x_1 if i=1 and in x_2 if i=2.
To be more precise:
i=1
def f(n):
while i
Others have alrea
On 07/03/2015 19:04, Alan Gauld wrote:
On 07/03/15 15:39, elie khairallah wrote:
hello , I would like to know if theres a way to change a variable's name
after every iteration for example I want to make a function that stores a
number in x_1 if i=1 and in x_2 if i=2.
To be more precise:
i=1
def
13 matches
Mail list logo