Microbit temperature in python

The BBC micro:bit does not have a dedicated temperature sensor. Instead, the temperature provided is actually the temperature of the silicon die on the main CPU.

So not a perfect measure of the temperature of a room but can be used a rough guide, you could also use this to monitor that your micro bit processor is not overheating

Code

from microbit import *
 
while True:
    sleep(5000)
    print(str(temperature())+" degrees C")

Testing

28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C
28 degrees C