Can someone tell me what i am doing wrong? I am writing a program using loops in Python 3.x, but when i execute program i am getting a traceback error:
multiple of 13 is 195 and factors are as follows Traceback (most recent call last): File "C:/Users/Darlene/Desktop/Chapter 4/program4_2.py", line 19, in list1.append(j) AttributeError: 'dict' object has no attribute 'append'
this is the code i entered:
def main():
for i in reversed(list(range(100,201))):
if i%13==0:
print("multiple of 13 is",i,"and factors are as follows")
list1 = {}
for j in list(range(2,i+1)):
if i%j == 00:
list1.append(j)
print(list1)
main()
list1 = {}declares a dictionary, not a list, thus there is noappendmethod associated with it.