Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Differentiate between range and xrange.

Answers were Sorted based on User's Feedback



Differentiate between range and xrange...

Answer / nashiinformaticssolutions

Functionality-wise, xrange and range are nearly identical. Both of these let you create an integer list that you may use however you like. The only distinction between xrange and range is that x range returns an xrange object, whereas range returns a Python list object. Range will use as much memory as possible to produce your array of numbers, which can result in a memory error and crash your program. This is particularly true if you are working with a device that needs a lot of memory, like a phone. It has a memory issue and is a beast.

Is This Answer Correct ?    0 Yes 0 No

Differentiate between range and xrange...

Answer / glibwaresoftsolutions

Functionality-wise, xrange and range are nearly identical. Both of these let you create an integer list that you may use however you like. The only distinction between xrange and range is that x range returns an xrange object, whereas range returns a Python list object. Range will use as much memory as possible to produce your array of numbers, which can result in a memory error and crash your program. This is particularly true if you are working with a device that needs a lot of memory, like a phone. It has a memory issue and is a beast.

Is This Answer Correct ?    0 Yes 0 No

Differentiate between range and xrange...

Answer / hr@tgksolutions.com

Functionality-wise, xrange and range are nearly identical. Both of these let you create an integer list that you may use however you like. The only distinction between xrange and range is that x range returns an xrange object, whereas range returns a Python list object. Range will use as much memory as possible to produce your array of numbers, which can result in a memory error and crash your program. This is particularly true if you are working with a device that needs a lot of memory, like a phone. It has a memory issue and is a beast.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is set () in python?

0 Answers  


Which python library would you prefer to use for data munging?

0 Answers  


Why do array indexes start with 0 in most languages?

0 Answers  


What is a lambda in coding?

0 Answers  


What is the difference between the shallow copy and deep copy in python?

0 Answers  


Can notepad ++ run python?

0 Answers  


What is pip?

2 Answers  


What does input () do in python?

0 Answers  


How is unit test done in python?

0 Answers  


Is there an inherent do-while loop in Python?

2 Answers  


List down some of the pdb commands for debugging python programs?

0 Answers  


Differentiate between lists and tuples?

0 Answers  


Categories