Created
July 4, 2018 13:16
-
-
Save lrlucena/c715f9a0d1fd792cb927e7266a1b93ae to your computer and use it in GitHub Desktop.
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
M = input() | |
M1, M2, M3 = int(M[-3]),int(M[-2]),int(M[-1]) | |
M1M3=M1*10+M3 | |
M1M2=M1*10+M2 | |
M2M3=M2*10+M3 | |
M2M1=M2*10+M1 | |
M3M1=M3*10+M1 | |
M3M2=M3*10+M2 | |
print(M1, M2, M3) | |
def f1(a,b,c): | |
d = a+b*c | |
return d | |
a = M3+1 | |
b = (M2+2)*M3 | |
c=a+b | |
d=f1(c,b,a) | |
print(d) | |
print("=======") | |
def f2(l1,l2): | |
l3 = [] | |
for i in range(0, len(l1)): | |
for j in range(0, len(l2)): | |
if(l1[i]==l2[j]): | |
l3.append(l1[i]) | |
return len(l3) | |
l = [M1M3,M1M2,M2M3,M3M1,M3M2,M3] | |
l.append(M2) | |
m = [len(l),M1,M2,M2M3,M3M2,M3] | |
n=f2(m,l) | |
print(n) | |
print("=======") | |
def f3(a,b): | |
c=0 | |
if a%b==0: | |
c=1 | |
return c | |
def f4(a): | |
c=0 | |
for i in range(1,a): | |
c=c+f3(a,i) | |
return c | |
x=M2+M3+20 | |
y=31 | |
a=f4(x) | |
b=f4(y) | |
print(a,b,f4(a+b)) | |
print("=======") | |
def count(lista): | |
k=0 | |
for ind in range(1, len(lista)): | |
if lista[ind] > lista[ind-1]: | |
k=k+1 | |
return k | |
l = [2,M2,M3,M2M1,4,M1M2,1,0,M3*5] | |
q=count(l) | |
print(q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment