Python

Python Menu

Python

Python String join() - Definition, Syntax, Parameters, Examples

Definition

The join() method takes all items in an iterable and joins them into one string. A string must be specified as the separator.

Syntax

string.join(iterable)

Parameters

Parameter Description
iterable Required. Any iterable object where all the returned values are strings

Examples:

fruits = ("apple", "banana", "orange") result = ", ".join(fruits) print(result) # another example car = {"name": "Ford", "model": 1987} mySeparator = " *** " result = mySeparator.join(car) print(result)

Introduction

Python Basics

Python Advance

Data Science Python Tutorials

Python Functions and Methods