美文网首页
MATH PYTHON Basic

MATH PYTHON Basic

作者: Python_Camp | 来源:发表于2022-10-03 14:51 被阅读0次

def oddEveniter(nth,pace):
    x = 1
    ans = []
    for s in range(1,nth+1):
        ans.append(x)
        if not s % 5:
            x += 1
        else:
            x += 2
    return ans[-1]
    
print(oddEveniter(100,5))
180

第二个任务

solve by Math

3的倍数百十个位相加为3的倍数,501整除3;

7的倍数7*71= 497,504整除7;

650-500 = 150;150//3 = 50;150//7 = 21

500->650之间有49个数整除3;20个整除7;同时整除3和7的有多少?
2120 + 214 = 504
150//21 = 7

150 - 49 - 21 + 7 = 87

solve by Python


def divisable(start,end,d1,d2):
    ans = []
    for n in range(start,end+1):
        if n%d1 and n%d2:
            ans.append(n)
    return len(ans)
    
start,end,d1,d2 = 500,650,3,7
print(divisable(start,end,d1,d2))
87

第三个任务

length / (s_girl + s_escalator) = 45 (1)

length / (s_girl - s_escalator) = 135 (2)

find thatlength/girl = ?

1/45 + 1/135 = 2 * s_girl / length

so that:
length/(2*girl) = 1 / (4/135)

length/girl = 135/2 = 67.5

图中,ABC是等边三角形。以 P、Q 和 R 为中心的圆的绘制方式使得它们接触大圆和三角形的边,并且具有最大可能的半径。

大圆的半径是8厘米。
求#Triangle PQR 的

本文由mdnice多平台发布

相关文章

网友评论

      本文标题:MATH PYTHON Basic

      本文链接:https://www.haomeiwen.com/subject/lsreartx.html