Skip to content

Instantly share code, notes, and snippets.

@ibelgin
Created December 18, 2020 15:13
Show Gist options
  • Save ibelgin/7412c321178205982e03452394f90301 to your computer and use it in GitHub Desktop.
Save ibelgin/7412c321178205982e03452394f90301 to your computer and use it in GitHub Desktop.
import math
n1 = int(input("Number1 ->"))
n2 = int(input("Number2 ->"))
print (math.gcd(n1,n2))
# or
def gcd(n1,n2):
if(n2==0):
return n1
else:
return gcd(n2,n1%n2)
n = input("Number -> ")
if (n == n[::-1]):
print("Yes")
else:
print("No")
a=int(input("Enter ->"))
final = ""
for i in list(str(a))[::-1]:
final += str(i)
print(int(final))
n = 123
sum = 0
for i in str(n):
sum += int(i)
print(sum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment