Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

[perl-python] Range function
Today we'll be writing a function called Range. The Perl documentation
is as follows.

Perl & Python & Java Solutions will be posted in 48 hours.

This is Perl-Python a-day. See
http://xahlee.org/web/perl-python/python.html

Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/

--------------------------

Range

Range($iMax) generates the list [1, 2, ... , $iMax].

Range($iMin, $iMax) generates the list [$iMin, ... , $iMax].

Range($iMin, $iMax, $iStep) uses increment $iStep, with the last
element
in the result being less or equal to $iMax. $iStep cannot be 0. If
$iStep is negative, then the role of $iMin and $iMax are reversed.

If Range fails, 0 is returned.

Example:

Range(5); # returns [1,2,3,4,5]

Range(5,10); # returns [5,6,7,8,9,10]

Range( 5, 7, 0.3); # returns [5, 5.3, 5.6, 5.9, 6.2, 6.5, 6.8]

Range( 5, -4, -2); # returns [5,3,1,-1,-3]


Report this thread to moderator Post Follow-up to this message
Old Post
Xah Lee
05-13-05 09:13 PM


Re: [perl-python] Range function
Xah Lee wrote:
> Today we'll be writing a function called Range.

I don't think so. Unless you meant to write "Today WE'll be writing ...."

> The Perl documentation is as follows.

Bullshit. The Perl documentation is part of any Perl installation but you
didn't link to it anywhere left alone quote it.
Actually I'm glad you didn't, it's quite large after all.

jue




Report this thread to moderator Post Follow-up to this message
Old Post
Jürgen Exner
05-13-05 09:13 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Scheme archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:00 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.