from machine import Pin
import dht

sensor = dht.DHT22(Pin(4))
sensor.measure()
temp = sensor.temperature()
hum = sensor.humidity()
print(hum, temp)