This code usually puts the smallest number in the inputed list in the front of the list, but for some reason, whenever 12
and 2
are inputed like so Please enter your cards(x, y, z,...): 12, 2
it outputs
12, 2
12, 2
Here is the code:
#!/usr/bin/python2.7
cards_input = raw_input("Please enter your cards(x, y, z, ...): ")
print cards_input
cards = cards_input.split(", ")
minimum = min(cards)
cards.remove(min(cards))
cards.insert(0, minimum)
print cards
How can I fix this?