Question: I'm still trying to learn on python.
I've created a list of fruit as follow

```
fruitList = ["pear","apple","strawberry","banana","orange"]

```

I would like to print them out in alphabetical order using for loop and while loop.

```
   fruitList.sort()

```

because python have this function called sort() thus, I'm able to sort.
But what if I do not want to use the sort function?

However, right now, I've issue on how to sort using while loop?
can someone tell me how am I able to do so?
This is what I've tried, using len()

```
for fruit in fruitList:
    while (len(fruitList[0]) > len(fruit[0])):
            fruit += 1
            print fruit
            continue

```

Nothing is printed when I run this program.
In a while loop, am I suppose to compare with the index[0] or can I use sort function as well?

Answer: 
The build in sort rutines does not require usage of neither for or While

If you want to learn for/while, look at some tutorials or something. 

<https://wiki.python.org/moin/ForLoop>

To sort your list do something like this

```
fruitList = ["pear","apple","strawberry","banana","orange"]
print sorted(fruitList)
print fruitList
fruitList.sort()
print fruitList

```

output :

```
['apple', 'banana', 'orange', 'pear', 'strawberry']
['pear', 'apple', 'strawberry', 'banana', 'orange']
['apple', 'banana', 'orange', 'pear', 'strawberry']

```
Now you iterate over the list, and for each fruit you sort the list again and again. You don't need this. Just do

```
print sorted(fruitList)

```