while loop

card_deck = [4, 11, 8, 5, 13, 2, 8, 10]
hand = []

while sum(hand) <= 17:
	hand.append(card_deck.pop())

print(hand)
&#91;/python&#93;

&#91;python&#93;
manifest = &#91;&#91;"bananas", 15&#93;, &#91;"mattresses", 34&#93;, &#91;"dog kennels", 42&#93;,&#91;"machine that goes ping!", 120&#93;, &#91;"tea chests", 10&#93;, &#91;"cheeses", 0&#93;&#93;

cargo_weight = 0
cargo_hold = &#91;&#93;

for cargo in manifest:
	if cargo_weight >= 100:
		break
	else:
		cargo_hold.append(cargo[0])
		cargo_weight += cargo[1]
cargo_weight = 0
cargo_hold = []

for cargo in manifest:
	print("debug: the weight is currently: {}".format(cargo_weight))
	if cargo_weight >= 100:
		print("debug: breaking loop now!")
		break
	else:
		print("debug: adding item: {}".format(cargo[0]))
		print("debug: with weight: {}".format(cargo[1]))
		cargo_hold.append(cargo[0])
		cargo_weight += cargo[1]