Comment

Comment by justin_oaks

For the benefit of those not familiar with the Python string interpolation/formatting situation, I present 4 ways to perform the same string formatting:

    who='World'
    #1 - string concatenation
    'Hello, ' + who + '!' 

    #2 - % operator
    'Hello, %s!' % who

    #3 - format() method
    'Hello, {}!'.format(who)

    #4 - f-strings
    f'Hello, {who}!'
parent justin_oaks 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton