Aug-16-2017, 09:23 PM
(This post was last modified: Aug-16-2017, 10:10 PM by SummoningZ.)
How do I fix this problem, please help I need it by next week I have been trying for at least 2 weeks.
(Aug-16-2017, 09:08 PM)nilamo Wrote:(Aug-16-2017, 08:48 PM)SummoningZ Wrote: The error is "AttributeError: 'function' object has no attribute 'extend'"Which is what I said :)
As for pasting code, stick it in [ python] tags, and either right click and "paste without formatting" or ctrl+shift+v to do the same. The forum 100% allows indentation in code blocks:def spam(): return "eggs" for _ in range(5): print(spam())
first = ("JS","4C","KC","3H","5H","AD","10H") second = ("9H","7S","JD","6D","JC","2D","QC") third = ("5C","JH","4S","QS","8D","9D","4H") def packet(first,second,third): for i in range(0,21,3): first.insert(0, packet[i]) second.insert(0, packet[i+1]) third.insert(0, packet[i+2]) print("1: " + " ".join([str(card) for card in first])) print("2: " + " ".join([str(card) for card in second])) print("3: " + " ".join([str(card) for card in third])) selection = int(input("> ")) if selection == 1: packet.extend(second) packet.extend(first) packet.extend(third) elif selection == 2: packet.extend(first) packet.extend(second) packet.extend(third) elif selection == 3: packet.extend(first) packet.extend(third) packet.extend(second) print("You're thinking of the %s" % packet[10])Thats the code.