Can anyone help me with this code?
Jobs = ()
openFile = open(\'Jobs.txt\')
x = 1
while x != 0:
Stuff = openFile.readline(x)
if Stuff != \'\':
I had also experienced the same problem. But I found the solution. For me this worked. Problem:
w=[]
x=[],
y=[],
z=[]
for i in range(4):
w.append(i) # doesn't throw error
print(w)
This did not give error for w
because I had initialized w
to w = []
without comma(,) and it treated as list but when I applied the same for x
it gave the error because I have initialized it as x = [],
with comma here and it treated as tuple.
for i in range(4):
y.append(i) # throws error AttributeError: 'tuple' object has no attribute 'append'
print(y)
This solved for me and I have tried this in python3 in pycharm.