Hi, I have a coding project for school which involves me making a program to do the 21 card trick in python.
I have started to make the program but am stuck on why it is not running, here is what I have at the moment.
Thanks
I have started to make the program but am stuck on why it is not running, here is what I have at the moment.
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])If someone can help me fix this so it does the card trick it will be greatly appreciated.
Thanks