Audun Nes
Dec 29, 2020

Why not also mention string formatting? Not all string concatenation is for creating new strings. Often when working with strings, your end goal is providing some output to the end user.

a = 'Hello'
b = 'World'
logger.info(’{}, {}’.format(a, b))

Or newer syntax:

logger.info(f’{a}, {b}’)

PS, I was not able to make proper single quotes on this mobile keyboard

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Audun Nes
Audun Nes

Written by Audun Nes

Lead Cloud Engineer/Site Reliability Engineer from Copenhagen, Denmark. GitHub: https://github.com/avnes

No responses yet

Write a response