打印用户输入

时间:2016-04-09 01:37:12

标签: python list

它不想打印出用户输入的列表。我认为问题出在list = []

from HeapClass import Heap

def minHeap(list):
        heap = Heap() #

        lst = eval(input("Enter list of numbers: "))

        for v in lst:
                heap.add(v)

        for i in range(len(list)):
                list[len(list) - 1 - i] = heap.remove()

def main():
        list = [] This think the problem is here because it doesn't return a list but when I write list = lst... It does not work either 
        minHeap(list)
        for v in list:
                print(str(v)+  " ", end = " ")

main()

0 个答案:

没有答案