Skip to content
Advertisement

How to use .join() and .format() together in python

I am trying to use .join() and .format() together in the same loop, but unable to do so.

Sample Data:

JavaScript

Filtering out phone number as below:

JavaScript

I want to format the phone number in the below format, can anyone suggest me how to pass the below format:

JavaScript

Getting output as: tel:123.456.7890

But I want the output as: 123 456 7890

Advertisement

Answer

JavaScript

Result:

JavaScript

This makes:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement