

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to do string concatenation without '+' operator in Python?
You can use str.join(list_of_strings) from the string class. The string you call it on is used to join the list of strings you provide as argument to it.
For example
>>> ' '.join(['Hello', 'World']) 'Hello World' >>> ''.join(['Hello', 'World', 'People']) 'HelloWorldPeople' >>> ', '.join(['Hello', 'World', 'People']) 'Hello, World, People'
Note that the string we call it on is inserted in between the list of strings we pass it as argument.
- Related Questions & Answers
- What does 'in' operator do in Python?
- What does 'is' operator do in Python?
- What does colon ':' operator do in Python?
- What does 'not in' operator do in Python?
- What does 'is not' operator do in Python?
- String Concatenation by + (string concatenation) operator.
- Finding the sum of two numbers without using '+', '-', '/', '*' in JavaScript
- How does the 'in' operator work on a tuple in Python?
- What is 'delete' Operator in JavaScript?
- What is 'new' Operator in JavaScript?
- What is 'void' Operator in JavaScript?
- Program to find number of string we can make where 'a' can be 'a' or 'b', and 'b' remains 'b'in Python
- How can I use 'Not Like' operator in MongoDB?
- Count Binary String without Consecutive 1's
- What does the 'b' character do in front of a string literal in Python?
Advertisements