2022-10-19 08:28:58 -07:00

14 lines
298 B
Python

states = ["Kansas", "Nebraska", "North Dakota", "South Dakota"]
.
.
.
# singles: Imperative version
def imperative_singles(states):
singles = []
for state in states:
if len(state.split()) == 1:
singles.append(state)
return singles
print(imperative_singles(states))