GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gcd lcm · optionalg/StarterLearningPython@a855ae6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • newcodes/answers
    • q60.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎newcodes/answers/q60.py‎

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python
2+
# coding=utf-8
3+
4+
def gcd(m, n):
5+
return m if n == 0 else gcd(n, m % n)
6+
7+
def lcm(m, n):
8+
return m * n // gcd(m, n)
9+
10+
if __name__ == "__main__":
11+
m = int(input("input m:"))
12+
n = int(input("input n:"))
13+
print("GCD", gcd(m, n))
14+
print("LCM", lcm(m, n))

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.