python – What does the x for x in syntax mean?

python – What does the x for x in syntax mean?

This is just standard Python list comprehension. Its a different way of writing a longer for loop. Youre looping over all the characters in your string and putting them in the list if the character is a digit.

See this for more info on list comprehension.

python – What does the x for x in syntax mean?

Leave a Reply

Your email address will not be published. Required fields are marked *