trouble to print array contents using slice operator

Michael.Coll-Barth at VerizonWireless.com Michael.Coll-Barth at VerizonWireless.com
Sat Apr 16 10:43:37 EDT 2005


print a[10:15] 
or 
print a[10:]



-----Original Message-----
From:
python-list-bounces+michael.coll-barth=verizonwireless.com at python.org
[mailto:python-list-bounces+michael.coll-barth=verizonwireless.com at pytho
n.org]On Behalf Of praba kar
Sent: Saturday, April 16, 2005 10:28 AM
To: python-list at python.org
Subject: trouble to print array contents using slice operator


Dear all,

   In Php array_slice function base
we can print array contents as per our desire
eg)

$a = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
$arr = array_slice($a,10,10);

this function will print 11,12,13,14,15

But I try to print the same thing in python
using slice operator 

eg) print a[10:10] 

This statement print [] empty array.  

How I need to get my desired output like php
array_slice function?

with regards
Prabahar



 

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
-- 
http://mail.python.org/mailman/listinfo/python-list
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure.  If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof.  Thank you.




More information about the Python-list mailing list