Tested with the heroku online demo:
def foo():
truc = 5
return f'bidule {truc}'
Result:
def foo():
truc = 5
return ''.join(['bidule ', '{}'.format(truc)])
It works but kind of ugly, should be "bidule {}".format(truc); or with keyword argument "bidule {i}".format(i=truc)