Skip to content

Instantly share code, notes, and snippets.

@TreavVasu
Last active December 6, 2016 09:32
Show Gist options
  • Save TreavVasu/94c455b884cc1c739343c3abba49e336 to your computer and use it in GitHub Desktop.
Save TreavVasu/94c455b884cc1c739343c3abba49e336 to your computer and use it in GitHub Desktop.
Some Python Projects
#  Some python projects of My creation , Of cource
b=0
for x in range (100,1000,1):
s=x%10
m=(x/10)%10
n=x/100
b=b+1
tot=s**3+m**3+n**3
if tot==x:
print x
print "Loop gone times,",b
n=input("Enter a no")
a=n*n
s=0
while n>0:
r=n%10
s=s*10+r
n=n/10
b=s*s
e=0
while b>0:
c=b%10
e=e*10+c
b=b/10
if e==a:
print "no is a magic no "
else:
print "Nope"
n=input("No of Lines:")
for c in range(0,n):
for c in range(0,n-c):
print" ",
for x in range(1,n-c):
print x,
for m in range(1,n-1-c):
print x-m,
print
#A Vasu Creation
for c in range(1,9):
for i in range(0,c):
print" ",
for m in range(0,9-c):
print"*",
for n in range(0,7-c):
print" ",
for x in range(0,10-c):
print"*",
print
#Fermats little Theoram
x=input("N:::")
a=2
m=a**(x-1)
if m%x>1:
print "composite"
else:
print"prime"
x=input("NUM:::::::::::::::::")
y=input("NUM:::::::::::::::::")
if x > y:
greater = x
else:
greater = y
lcm=0
while lcm==0:
if greater % x == 0 and greater % y == 0:
lcm = greater
break
greater += 1
print lcm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment