Skip to content

Latest commit

 

History

History

ep017

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Today I explain a tricky "feature" of python that is pretty easy to trip up on: string literal joining.

Interactive examples

Python

'hello' 'world'

def f():
    return 'hello' 'world'

import dis
dis.dis(f)

def f():
    return 'hello' + 'world'

dis.dis(f)

x = 'thing'
'hello' f'{x}!'

Bash

gcc t.c
./a.out