import math
def ppi(height,width,screensize):
diagonal = math.sqrt(height ** 2 + width ** 2)
return diagonal/screensize
height = int(input("enter the height of the screen"))
width = int(input ("enter the width of the screen"))
screensize = float(input ("enter the size of the screen"))
print( ppi(height,width,screensize))
运行如下