练习4--python实现计算屏幕ppi

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))

运行如下
在这里插入图片描述

发布了36 篇原创文章 · 获赞 65 · 访问量 2909

猜你喜欢

转载自blog.csdn.net/Miracle1203/article/details/102822519
PPI