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 144 views
1 answer 110 views
3 answers 179 views
179 views asked Apr 24, 2021 by avibootz
2 answers 244 views
1 answer 156 views
...