⊗pyPmBsSMu 23 of 208 menu

Multiplying Strings in Python

Python also allows you to multiply strings, i.e. increase the number of the same string by a certain number.

Let's multiply our string by 3 times:

print(3 * 'abc') # 'abcabcabc'

Write how you can get the following result:

'a1b2a1b2a1b2a1b2'

Write how you can get the following result:

'abab1213'
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline