Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

파이썬 기본 문법 테스트

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

파이썬에서 사용되는 기본 자료형은 무엇인가요?

a)

정수형, 실수형, 문자형

b)

음수, 양수, 0

c)

정수, 문자열, 함수

d)

배열, 객체, 문자열

2.

turtle 모듈에서 거북이를 앞으로 이동시키는 명령어는 무엇인가요?

a)

step()

b)

forward()

c)

move()

d)

backward()

3.

random 모듈을 사용하여 1부터 10까지의 랜덤 숫자를 생성하는 코드는 무엇인가요?

a)

random.randint(0, 10)

b)

random_number = random.random(1, 10)

c)

import random as rnd rnd.random(1, 10)

d)

import random random_number = random.randint(1, 10)

4.

조건문에서 'if'와 'else'의 역할은 무엇인가요?

a)

'if'는 조건이 참일 때 실행되는 블록을, 'else'는 조건이 거짓일 때 실행되는 블록을 정의합니다.

b)

'else'는 조건이 참일 때 실행되는 블록을 정의한다.

c)

'if'와 'else'는 서로 대체 가능한 역할을 한다.

d)

'if'는 항상 실행되는 블록을 정의한다.

5.

for 반복문을 사용하여 1부터 5까지 출력하는 코드는 무엇인가요?

a)

for i in range(1, 7): print(i)

b)

for i in range(1, 5): print(i)

c)

for i in range(0, 5): print(i)

d)

for i in range(1, 6): print(i)

6.

turtle 모듈에서 거북이를 회전시키는 명령어는 무엇인가요?

a)

rotate(angle)

b)

turn(angle)

c)

spin(angle)

d)

right(angle) or left(angle)

7.

while 반복문을 사용하여 10보다 작은 숫자를 출력하는 코드는 무엇인가요?

a)

i = 0; while (i < 10) { print(i); i++; }

b)

for (i = 0; i < 10; i++) { print(i); }

c)

i = 1; while (i < 10) { print(i); i++; }

d)

while (i <= 10) { print(i); i++; }

8.

turtle 모듈에서 색상을 변경하는 방법은 무엇인가요?

a)

Change color using turtle.paint('color_name')

b)

Use turtle.color('color_name') or turtle.color(r, g, b) to change the color.

c)

Set color with turtle.fill('color_name')

d)

Use turtle.setcolor('color_name')

9.

random 모듈에서 리스트에서 랜덤으로 요소를 선택하는 함수는 무엇인가요?

a)

sample

b)

choice

c)

random

d)

shuffle

10.

조건문에서 'elif'의 역할은 무엇인가요?

a)

'elif'는 여러 조건을 검사할 수 있게 해주는 역할을 한다.

b)

'elif'는 프로그램을 종료하는 역할을 한다.

c)

'elif'는 조건을 무시하는 역할을 한다.

d)

'elif'는 조건을 반복하는 역할을 한다.

11.

turtle 모듈에서 배경색을 설정하는 방법은 무엇인가요?

a)

Use turtle.bgcolor('color') to set the background color.

b)

Call turtle.bg('color') to modify the background color.

c)

Set the background color with turtle.color('color').

d)

Use turtle.setbgcolor('color') to change the background color.

12.

조건문을 사용하여 짝수와 홀수를 구분하는 코드는 무엇인가요?

a)

if (number % 2 == 0) { console.log('Odd'); } else { console.log('Even'); }

b)

if (number % 2 == 0) { console.log('Even'); } else { console.log('Odd'); }

c)

if (number % 2 != 0) { console.log('Even'); } else { console.log('Odd'); }

d)

if (number % 2 == 1) { console.log('Even'); } else { console.log('Odd'); }