What is the different between range () and xrange () functions in python?



What is the different between range () and xrange () functions in python?..

Answer / Shakti Singh Gurjar

The main difference between range() and xrange() functions in Python is that range() generates a list of numbers, while xrange() generates an iterator. Using xrange() can save memory when working with large ranges, as it doesn't create the entire sequence at once.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is a repl in python?

1 Answers  


What is the default argument in all the functions inside a class?

1 Answers  


How do you implement json given that python is best suited for the server-side application?

1 Answers  


How to run a Python CGI script in Wamp?

1 Answers  


Explain python is one line?

1 Answers  


What is the mro in python?

1 Answers  


What is a docstring in python?

1 Answers  


Is python good for coding?

1 Answers  


python is case sensitive ?

1 Answers  


Tell me what is flask & its benefits?

1 Answers  


What is a singleton python?

1 Answers  


Explain in detail – inheritance in python?

1 Answers  


Categories