Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #91829

Re: How to access the low digits of a list

From Frank Stutzman <stutzman@cat2.kjsl.com>
Newsgroups comp.lang.python
Subject Re: How to access the low digits of a list
Date 2015-06-02 12:34 +0000
Organization Nothing witty to write here
Message-ID <mkk7s6$1iut$1@news.kjsl.com> (permalink)
References <efe9d48e-9aaf-4e68-aa26-c83da32e80f5@googlegroups.com>

Show all headers | View raw


fl <rxjwg98@gmail.com> wrote:

---snip----
>>>> lines
> ['12', '42', '49', '156', '225', '36', '49', '164', '11181', '3100']
> 
> 
> 
> I want to access the last two digits. That is:
> 
> ['12', '42', '49', '56', '25', '36', '49', '64', '81', '00']
> 
> 
> When I try to use lines[3][0] is '1'
> lines[3][1] is '5'
> lines[3][2] is '6'

Is there something wrong with using:
   lines[3][-2:]
   

-- 
Frank Stutzman

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to access the low digits of a list fl <rxjwg98@gmail.com> - 2015-06-02 05:23 -0700
  Re: How to access the low digits of a list Joel Goldstick <joel.goldstick@gmail.com> - 2015-06-02 08:32 -0400
  Re: How to access the low digits of a list Frank Stutzman <stutzman@cat2.kjsl.com> - 2015-06-02 12:34 +0000
  Re: How to access the low digits of a list Rustom Mody <rustompmody@gmail.com> - 2015-06-02 05:35 -0700
    Re: How to access the low digits of a list Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-02 08:19 -0600
      Re: How to access the low digits of a list Rustom Mody <rustompmody@gmail.com> - 2015-06-03 14:08 -0700
        Re: How to access the low digits of a list Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-03 22:41 +0100
        Re: How to access the low digits of a list Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-03 16:36 -0600
        Re: How to access the low digits of a list Steven D'Aprano <steve@pearwood.info> - 2015-06-04 23:27 +1000
  Re: How to access the low digits of a list Steven D'Aprano <steve@pearwood.info> - 2015-06-03 01:11 +1000

csiph-web