Possible Duplicate:
strange while statement behaviour?
Given the following, how may I implement list comprehension correctly, exit the loop & run the statements after 'else'? I had tried to scan for '-' characters but it does not work.
Have tried:
while(current != randomValue) Trying now:
randomKey = random.choice(list(topic.keys())) randomValue = random.choice(topic[randomKey]) current = "-" * len(randomValue) while (i for i in range (0, len(current)) if i != "-"): (statements) else: (statements)