> ## Content Index
> Fetch the complete content index at: https://bioinformatics.ghost.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Finally! In line interpolation in Python
- URL: https://bioinformatics.ghost.io/finally-in-line-interpolation-in-python/
- Published: 2017-11-05T01:05:27.000Z
- Updated: 2017-11-05T01:05:27.000Z
- Author: Aarthi Ramakrishnan
- Tags: programming, #Import 2026-08-27 15:34

In Bash, one can often pass a variable in an echo statement as follows:

```bash
VARIABLE1="Text1"
VARIABLE2="Text2"
echo This is an example string: $VARIABLE1, $VARIABLE2

```

This is really convenient in Bash. But in python 2, it is more complicated. Following is the only way one could format a string:

```python
variable1 = "TEXT1"
variable2 = "TEXT2"
print "This is an example string: {0}, {1}".format(variable1, variable2)

```

The above becomes tedious if one were to pass more than 10 arguments for format. Following is a better way (albeit in Python 3):

```python
variable1 = "TEXT1"
variable2 = "TEXT2"
print(f"This is an example string: {variable1}, {variable2}")

```