Commeted step-by-step:
# This creates a comma delimitered string number = "9,234,456,123,456,789" # An empty string variable cleanedNumber = '' # this looks at number, character by character, (9, then , then 2 ...) for char in number: # checks if char in (is part of) string '0123456789. (0, 1, 2 ... or 9), (could have used isdigit) if char in '0123456789': # This sets the appends the value of char to the current value of cleaned Number cleanedNumber = cleanedNumber + char # this sets newNumber to the integer value of cleanedNumber newNumber = int(cleanedNumber) # This displays value of newNUmber print("the Number is {}".format(newNumber)) # This sets state to each of the four strings, one each iteration for state in {"not pinin'","no more", "a stiff", "bereft or life"}: # Display the value of state. print("This parrot is "+ state)