Created
September 26, 2019 05:43
-
-
Save geekykant/bfe889eeb57244f2c3ce444e311dd337 to your computer and use it in GitHub Desktop.
This file contains 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
def isprimebad(n): | |
if n < 2: | |
return(False) | |
else: | |
for i in range(2,n): | |
if n%i == 0: | |
return(False) | |
return(True) | |
def lexsortbad(l): | |
for j in range(len(l)-1): | |
for i in range(len(l)-1): | |
if l[i][0] > l[i+1][0]: | |
(l[i],l[i+1]) = (l[i+1],l[i]) | |
return(l) | |
elif x >= w and x >= y and x >= z: | |
maximum = x | |
elif y >= w and y >= x and y >= z: | |
maximum = y | |
else: | |
maximum = z | |
def sumofsquares(n) : | |
i = 1 | |
while i * i <= n : | |
j = 1 | |
while(j * j <= n) : | |
if (i * i + j * j == n) : | |
return True | |
j = j + 1 | |
i = i + 1 | |
return False | |
def subsequence(sub, main): | |
flag = True | |
for item in sub: | |
if(item in main): | |
main.remove(item) | |
else: | |
flag = False | |
return flag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment