return.
def upto(text, stop):
for ch in text:
if ch == stop:
return
yield ch
print("".join(upto("data,science", ",")), list(upto("abc", "z")), list(upto(",x", ",")))
What does the program print?Log in to join the discussion.
Loading…