Hi,
I want to add up all of the list elements. But when I use the "map" function,
it didn't seem to work as I expect. Could someone point out how "map" can be
applied here then?
def add_all_elements (*args):
total = 0
for i in args:
print(type(i))
print("i = %s" % i)
t.__next__()
> (4, 1)
> >>> aList.__next__()
> (5, 8)
> >>> aList.__next__()
> Traceback (most recent call last):
> File "", line 1, in
> StopIteration
> >>>
>
>
> -Original Message-
> From: Python-list
> [mailt
On Thursday, September 6, 2018 at 10:34:19 AM UTC-7, Chris Angelico wrote:
> On Fri, Sep 7, 2018 at 3:26 AM, Viet Nguyen via Python-list
> wrote:
> >>>> numList
> > [2, 7, 22, 30, 1, 8]
> >
> >>>> aList = enumerate(numList)
> >
> >>&g
>>> numList
[2, 7, 22, 30, 1, 8]
>>> aList = enumerate(numList)
>>> for i,j in aList:print(i,j)
0 2
1 7
2 22
3 30
4 1
5 8
>>> for i,j in aList:print(i,j)
>>>
--
https://mail.python.org/mailman/listinfo/python-list
On Friday, October 3, 2014 12:48:08 AM UTC-7, Peter Otten wrote:
> Viet Nguyen wrote:
>
>
>
> > On Thursday, October 2, 2014 10:34:15 PM UTC-7, Viet Nguyen wrote:
>
> >> Hi,
>
> >>
>
> >>
>
> >>
>
> &g
On Thursday, October 2, 2014 10:47:28 PM UTC-7, Ian wrote:
> On Thu, Oct 2, 2014 at 11:34 PM, Viet Nguyen
>
> wrote:
>
> > Hi,
>
> >
>
> > When I am debug mode, is there some command which will help display the
> > source code for a Python functi
On Thursday, October 2, 2014 10:34:15 PM UTC-7, Viet Nguyen wrote:
> Hi,
>
>
>
> When I am debug mode, is there some command which will help display the
> source code for a Python function of interest? Much like you'd use "info
> proc" to display con
Hi,
When I am debug mode, is there some command which will help display the source
code for a Python function of interest? Much like you'd use "info proc" to
display contents of Tcl proc.
Thanks,
Viet
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
If any is familiar with pexpect, please help to point out why my script seems
to fail to capture the desired text.
Here, I want to log into a server 172.27.161.19. Once I see "Username: ", I
will type in my userid "admin".
The problem here is I have a list of keywords for pexpect to match
On Thursday, September 11, 2014 10:15:57 PM UTC-7, Viet Nguyen wrote:
> Can anyone give me hint or reason why same command behaves differently in
> debugger mode from interactive mode:
>
>
>
> From interactive mode:
>
>
>
> >>> import os
>
Can anyone give me hint or reason why same command behaves differently in
debugger mode from interactive mode:
>From interactive mode:
>>> import os
>>> p = os.popen('date')
>>> p.read()
'Thu Sep 11 11:18:07 PDT 2014\n'
But from debugger mode in a script:
>>> import os
(Pdb) p = os.popen('date'
11 matches
Mail list logo