Question: What is the difference between range and xrange?Answer:Both methods are mainly used in Python to iterate the for loop for a fixed number of times. They differ only when we talk about Python versions. The difference between range and xrange is as follows:
|
Is it helpful?
Yes
No
Most helpful rated by users:
- What is Python?
- How do I share global variables across modules?
- How do you set a global variable in a function in Python?
- What type of language is Python? Programming or Scripting?
- Why can\'t I use an assignment in an expression?