How to use repeat() to repeat a value in Python

1 Answer

0 votes
from itertools import *     

for val in repeat('python', 3):       
    print(val)


    
   
'''
run:
 
python
python
python

'''

 



answered May 21, 2019 by avibootz

Related questions

1 answer 241 views
1 answer 185 views
3 answers 313 views
313 views asked Apr 24, 2021 by avibootz
2 answers 364 views
1 answer 245 views
...