for Python on Daniweb:
Please use the [code=python] and [/code] tag pair to enclose your python code.
Python code uses proper indentation as part of its code. Presenting unindented Python code forces the person that may want to help you to do this and discourages many.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
One quick hint, do not use list as a variable name it is a function in Python. Use something like mylist.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
Have you ever gotten your code to do anything? The way it is now it will not work, even in its simplest form.
sneekula
Nearly a Posting Maven
2,427 posts since Oct 2006
Reputation Points: 961
Solved Threads: 212
Neither can i understood the modification of list to mylist..
You don't want to use a Python builtin function as a variable name. Here is an example, first the normal use of the list() function ...
print list('abcde')
"""
my output -->
['a', 'b', 'c', 'd', 'e']
"""
Now make list is a variable name, this will give you an error when you want to use it as a function later ...
list = []
# lots
# of your
# code here
# finally comes the moment you want to use list as a function
print list('abcde')
"""
my output -->
TypeError: 'list' object is not callable
"""
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417