Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,166 questions

40,722 answers

573 users

How to use multiple yield statement in Python

1 Answer

0 votes
def multiple_yield():  
    str1 = "str1 String"  
    yield str1  
      
    str2 = "str2 string"  
    yield str2  
      
    str3 = "str2 String"  
    yield str3  

obj = multiple_yield()  

print(next(obj))  
print(next(obj))  
print(next(obj))  



'''
run:

str1 String
str2 string
str2 String

'''

 





answered Dec 2, 2022 by avibootz

Related questions

1 answer 71 views
1 answer 72 views
3 answers 85 views
85 views asked Jun 18, 2020 by avibootz
...