Q:

How to convert a vertical string in a list?

d = {'Banana' : {'price': 7, 'Color' : "yellow"},
'Apple' : {'price' : 8, 'Color': "green"}, 'Orange' :{'price' : 6, 'Color': "orange"}}
for fruit, props in dict.iteritems():
    prices= str(props['price']):

Now I want to have the price of each fruit in a list
print prices
6
7
8

 But if I use split(), I get:
print prices.split()
['6']
['7']
['8'] 
And what I really want is [6,7,8].
Can someone help me?

A:

You can use str.splitlines. From the documentation:

Return a list of the lines in the string, breaking at line boundaries.

You can use it like this:
>>> mystring = """1
2
3"""
>>> mylist = mystring.splitlines()
>>> print(mylist)
['1', '2', '3']

And since you want the lines as integers:
>>> mylist = [int(i) for i in mystring.splitlines()]
>>> print(mylist)
[1, 2, 3]

Keep in mind that you'll get an error if any line is not a integer or float.
EDIT (after the post revision):
It seems like your main problem is the for loop. You are setting prices on each iteration, overwriting the last. You should use something like this:
prices = []
for fruit, props in d.iteritems():
    prices.append(props['price'])

Then you have a list, looking like this:
[8, 6, 7]

Notice it has no order. This is because dictionaries are unstructured data types. From the docs:

It is best to think of a dictionary as an unordered set of key: value pairs, with the requirement that the keys are unique (within one dictionary).

If you want, you could sort your prices:
Least to Greatest
>>> sorted(prices)
[6, 7, 8]

Greatest to Least
>>> sorted(prices, reverse=True)
[8, 7, 6]

