wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

파이썬 기초 #3

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

요소의 순서가 없으며 중복값을 허용하지 않는 데이터 유형은?

a)

list

b)

tuple

c)

set

d)

dict

2.

a ={‘name’: ‘Lee’, ‘grade’: 2, ‘year’: 2008}

a의 데이터 유형은?

a)

list

b)

tuple

c)

set

d)

dict

3.

컬렉션 데이터 중 순서가 있는 것을 모두 고르세요.

a)

list

b)

tuple

c)

set

d)

dict

4.

데이터 유형을 바꾸지 않고는 항목을 삭제할 수 없는 데이터 유형은?

a)

list

b)

tuple

c)

set

d)

dict

5.

a = [1, 2, 3, 4, 5, 6]

print(a[3:5])

a)

[3, 4]

b)

[3, 4, 5]

c)

[4, 5]

d)

[4, 5, 6]

6.

a = [1, 2, 3, 4, 5, 6]

a의 요소 중 3을 10으로 변경하는 코드는?

a)

a(3) = 10

b)

a[3] = 10

c)

a(2) = 10

d)

a[2] = 10

7.

a = [1, 2, 3, 4, 5, 6]

요소 3과 4 사이에 다음과 같이 10을 추가하는 코드는?

a = [1, 2, 3, 10, 4, 5, 6]

a)

a[3] = 10

b)

a[4] =10

c)

a.insert(3, 10)

d)

a.append(10)

8.

a = [1, 2, 3, 4, 5, 6]

a의 요소 중 5를 삭제하는 코드는?

a)

a.del(5)

b)

a.pop(5)

c)

a.clear(5)

d)

a.remove(5)

9.

a = [5, 3, 7, 2, 1]을 오름차순으로 정렬하여

a = [1, 2, 3, 5, 7]로 만드는 코드는?

a)

a = sort( )

b)

a = sort(a)

c)

a.sort( )

d)

sort(a.reverse)

10.

a = (100, ‘Hello’, 15)

a의 데이터 유형은 무엇인가?

a)

list

b)

tuple

c)

str

d)

int

11.

a = {‘apple’, ‘banana’, ‘cherry’}

a에 요소 ‘orange’를 추가하는 코드는?

a)

a.add(‘orange’)

b)

a.append(‘orange’)

c)

a.pop(‘orange’)

d)

a.insert(‘orange’)

12.

a = {‘name’: ‘Lee’, ‘grade’: 2, ‘year’: 2008}

‘name’의 ‘Lee’를 ‘Kim’으로 수정하는 코드는?

a)

a[0] = ‘Kim’

b)

a[‘name’] = ‘Kim’

c)

a[‘Lee’] = ‘Kim’

d)

a.‘name’ = ‘Kim’

13.

파이썬의 match 구문에서 일치 항목이 없을 때 실행하는 코드문은?

a)

case pass:

b)

case none:

c)

case _:

d)

case else: