Initial commit: Python learning project with examples and exercises

This commit is contained in:
2025-07-20 17:08:50 +08:00
commit bc7bb56271
111 changed files with 11535 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#最小公倍数
a = int(input())
b = int(input())
def _gcd(x,y): #最大公约数
if x>y:
x,y=y,x
for i in range(x,0,-1):
if x%i==0 and y%i==0:
return i
def lcm(x,y): #最小公倍数
a = int((x*y)/_gcd(x,y))
return a
print(lcm(a,b))