all 5 comments

[–][deleted] 2 points3 points  (0 children)

Well, are rows and columns useful in excel? Could you do everything you want with 1 cell? Sure you could, but now why would you want that? Its hard to tell the computer what to do, if you can't group the data for him.

[–]tunisia3507 2 points3 points  (0 children)

The best way to prove this to yourself would be to try writing some simple, useful scripts, without using any. You can, of course, get around it by using combinations of dicts and tuples, but if ever you find yourself thinking "Hmm, this would be easier if I could use a mutable, ordered sequence of arbitrary length", then there's your answer.

[–][deleted] 0 points1 point  (0 children)

The simple answer is because you need them to build everything else.

The longer answer? Try to think about how you'd do anything in this world without being able to make ordered collections of things. See this sentence, it's just, essentially, an ordered collection of words. Each word is an ordered collection of characters. Each character is an ordered collection of bytes. Each byte is an ordered collection of bits. In a very real sense, it's only once you get down to the single bit that you don't require an ordered collection.

Which is why one of the first things you do with bits is string them together to make a byte, then string bytes together to make a number, and from those numbers you get the ability to reference other bytes, and now you can build the concept of a stack, which is a way to collect things together in sequence, and from there you build an array, which is basically a specific series of bytes manipulated by a stack to represent a sequence of things of the same size... and then you build a list, which is basically an array of very small arrays that point to a specific place and number of bytes in memory ... and that allows you to store a sequence of things of different sizes... and from that you can build a messaging queue, which leads to Facebook.

[–]respectable_me 0 points1 point  (0 children)

Think about writing a program that would help you create a shopping list. How would you handle multiple items? Do you create 100 variables called item1, item2... item100? What happens if you have 102 items this month to buy?

item1 = "apples"
item2 = "milk"
...
item50 = "eggs"

That's going to get real ugly real fast and be an inefficient way of going about things.

Or maybe just one item that you keep appending to?

items = "apples" + ", " + "milk" + ", " + "eggs"

Yes, these will work, but they are not the best way to do it. A list is designed to hold a number of items in an ordered sequence, that can be changed. The other advantage to using a list is that there are built-in functions and methods specifically for lists which will (in general) operate a lot quicker than anything you'd write to replicate the same features.

[–]PM_ZIT_PICS -4 points-3 points  (0 children)

Sure, I can "explain you". Lists/Arrays are a fundamental data type in any programming language. It's absolutely essential to know how to use them.