# Some python projects of My creation , Of cource
Last active
December 6, 2016 09:32
-
-
Save TreavVasu/94c455b884cc1c739343c3abba49e336 to your computer and use it in GitHub Desktop.
Some Python Projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
#A Vasu Creation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"*", | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Fermats little Theoram | |
x=input("N:::") | |
a=2 | |
m=a**(x-1) | |
if m%x>1: | |
print "composite" | |
else: | |
print"prime" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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