
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to print a string two times with single statement in Python?
When used with strings, asterisk (*) is defined as repetition operator. It concatenates given string as many times as number followed by asterisk.
>>> string = 'abcdefghij' >>> print (string*2) abcdefghijabcdefghij
- Related Articles
- How to use single statement suite with Loops in Python?
- How to join two strings to convert to a single string in Python?
- How to set two variables in a stored procedure with a single MySQL select statement?
- How to print a name multiple times without loop statement using C language?
- How to print double quotes with the string variable in Python?
- How to print concatenated string in Python?
- How to write inline if statement for print in Python?
- How to print all the elements of a String array in Kotlin in a single line?
- How to merge two Python dictionaries in a single expression?
- How to print a complete tuple in Python using string formatting?
- Print Single and Multiple variable in Python?
- How to create many Javascript variables in a single statement?
- How to alter multiple columns in a single statement in MySQL?
- How to concrete a single Series into a string Python Pandas library?
- How to print a string in Golang?

Advertisements