Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lcm and hcf
#python 3.6.9 def find_gcd(a,b): gcd = 1 for i in range(1,a+1): if a%i==0 and b%i==0: gcd = i return gcd first = int(input('Enter first number: ')) second = int(input('Enter second number: ')) print('HCF or GCD of %d and %d is %d' %(first, second, find_gcd(first, second))) lcm = first * second / find_gcd(first, second) print('LCM of %d and %d is %d' %(first, second, lcm))
run
|
edit
|
history
|
help
0
Game4
rstring
teste
pico menu
test
Sending email from python
Faiha Lesson 4
fibo_1
PyRegLookAhead
Asdf