How to get ° character in a string in python?

前端 未结 6 1082
南方客
南方客 2020-12-07 16:07

How can I get a ° (degree) character into a string?

6条回答
  •  情书的邮戳
    2020-12-07 16:46

    Put this line at the top of your source

    # -*- coding: utf-8 -*-
    

    If your editor uses a different encoding, substitute for utf-8

    Then you can include utf-8 characters directly in the source

提交回复
热议问题