Python

22-24 심사 문제 풀이 (수정중)

충 민 2022. 7. 28. 00:24

22.10

num1,num2 = map(int, input().split())
if 1<=num1<20 and 10<=num2<30 and num1<num2:
    a=[(2**i) for i  in range(num1,num2) ]
    a.pop(1) and a.pop(-2)
    print(a)

23.7

col , row = map(int,input().split())

matrix =[]
for i in range(row):
    matrix.append(list(input()))
       
dx=[0,0,-1,1] #상하좌우
dy=[-1,1,0,0]

for i in range(row):
    for j in range(col):
        for k in range(4):
            testX=i+dx[i]
            testY=i+dy[i]
            print(arr[testX][testY])

24.5

sentence=input().split()
d=0
for i in range(len(sentence)):
    d=sentence.count('the')
print(d)

24.6

a=input().split(';')
a=list(map(int,a))
a.sort(reverse=True)
for j in range(len(a)):
    print('%9s' % format(a[j],','))