Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 709 Bytes

File metadata and controls

27 lines (18 loc) · 709 Bytes

Strings [문자열]

Regular Expressions

Cheatsheet

String concatenation

String formatting

String Interpolation / f-Strings (Python 3.6+)

  • you can embed arbitrary Python expressions, you can even do inline arithmetic with it

Template Strings (Standard Library)

  • Use template strings when handling formatted strings generated by users of your program, due to their reduced complexity, template strings are a safer choice.
    if user_given_input:
        use Template Strings
    else:
        if __version__ >= 3.6:
            use f-Strings
        else:
            use String formatting