• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Programming Expert

Solving All of Your Programming Headaches

  • HTML
  • JavaScript
  • jQuery
  • PHP
  • Python
  • SAS
  • VBA
  • About
You are here: Home / Python / Using Python to Print Degree Symbol

Using Python to Print Degree Symbol

June 5, 2022 Leave a Comment

In Python, to print the degree symbol, you can use the unicode for the degree sign ‘\u00B0’.

print('\u00B0')  

°

When outputting text to the console or to a file, the ability to write different symbols easily is valuable.

One such symbol which is commonly used is the degree symbol. Degrees are used in different areas of science and math, such as weather or trigonometry.

Python has the ability to write many symbols and emojis since many symbols have a unicode associated with it.

To print the degree sign symbol, you can use the unicode for degrees ‘\u00B0’.

Below shows how you can print the degree symbol in Python.

print('\u00B0')  

°

If you are working with degrees and numbers representing degrees, you can use the following code to print degrees to the console with Python.

def format_degrees(deg):
    return str(deg) + '\u00B0' 

print(format_degrees(100))

#Output:
100°

Hopefully this article has been useful for you to learn how to print the degree symbol with Python.

Other Articles You'll Also Like:

  • 1.  Get Elapsed Time in Seconds in Python
  • 2.  String Contains Case Insensitive in Python
  • 3.  Pascal’s Triangle in Python
  • 4.  Remove Every Nth Element from List in Python
  • 5.  Get Days in Month Using Python
  • 6.  PROC MIXED Equivalent in Python for Least Squared Means ANOVA
  • 7.  How to Iterate Through Lines in File with Python
  • 8.  Check if List is Subset of Another List in Python
  • 9.  How to Iterate through a Set Using Python
  • 10.  Using Python to Check If a Number is a Perfect Square

About The Programming Expert

The Programming Expert is a compilation of a programmer’s findings in the world of software development, website creation, and automation of processes.

Programming allows us to create amazing applications which make our work more efficient, repeatable and accurate.

At the end of the day, we want to be able to just push a button and let the code do it’s magic.

You can read more about us on our about page.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

About The Programming Expert

the programming expert main image

The Programming Expert is a compilation of hundreds of code snippets to help you find solutions to your problems in Python, JavaScript, PHP, HTML, SAS, and more.

Search

Learn Coding from Experts on Udemy

Looking to boost your skills and learn how to become a programming expert?

Check out the links below to view Udemy courses for learning to program in the following languages:

Copyright © 2022 · The Programming Expert · About · Privacy Policy