473,511 Members | 15,364 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XRange

111 New Member
can you tell me what exactly is the use of Xrange() operator??
Jul 18 '07 #1
1 1609
bvdet
2,851 Recognized Expert Moderator Specialist
can you tell me what exactly is the use of Xrange() operator??
xrange() and range() are similar. range() returns a list of numbers. xrange() returns an object which generates the numbers on the fly. xrange() is useful primarily when dealing with a large range on a machine with limited memory.
Jul 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1408
by: Christopher T King | last post by:
Okay, so this is really two requests in one, and they're both kinda outlandish, but I'm gonna post them nonetheless: I've always thought xrange() to be ugly; it looks to be a lot of typing just...
6
1341
by: Gerrit Holl | last post by:
Hi, why is an xrange object not hashable? I was trying to do something like: comments = { xrange(0, 4): "Few", xrange(4, 10): "Several", xrange(10, 100): "A lot", xrange(100, sys.maxint):...
7
2571
by: Christian Neumann | last post by:
Hello, i have a problem with the built-in function xrange(). Could you by any chance be able to help? I use Python 2.3.4 (final) and i think there is a bug in the built-in
0
963
by: Christian Neumann | last post by:
Hello Robert! Sorry. It was my mistake! I read over this: "They don't support slicing" Thank you very much indeed! Christian Neumann
0
1034
by: Chris King | last post by:
You guys are probably sick of these by now, but I've come up with an xrange() replacement that is actually (almost) implementable in pure Python. Some have previously suggested the form "for...
35
2394
by: bonono | last post by:
Hi, I am wondering if there is such a thing, as python is moving away from FP functions like dropwhile/takewhile etc.
29
2846
by: Steve R. Hastings | last post by:
When you compile the expression for i in range(1000): pass does Python make an iterator for range(), and then generate the values on the fly? Or does Python actually allocate the list and...
17
2686
by: stdazi | last post by:
Hello! Many times I was suggested to use xrange and range instead of the while constructs, and indeed, they are quite more elegant - but, after calculating the overhead (and losen flexibility)...
3
2975
by: Bas | last post by:
Hi, stupid question, but would it be possible to somehow merge xrange (which is supposed to replace range in py3k) and slice? Both have very similar start, stop and step arguments and both are...
2
2202
by: Joe Goldthwaite | last post by:
I've been playing with Python a bit. Doing little performance benchmarks and working with Psyco. It's been fun and I've been learning a lot. For example, in a previous post, I was looking for a...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7418
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.