Variables and DECLARE · 변수와 DECLARE
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
A variable stores one value
- A variable has a name and holds one value you can change.
- The 2026 guide writes names in mixed case, starting with a letter:
NumberOfPlayersornumberOfPlayers. - These lessons use a capital first letter, the same shape as the guide's own examples.
한국어
변수는 하나의 값을 저장합니다
- 변수에는 이름이 있으며, 변경 가능한 하나의 값을 저장합니다.
- 2026 가이드는 대문자로 시작하는 혼합 표기법으로 이름을 작성합니다:
NumberOfPlayers또는numberOfPlayers. - 이 수업에서는 가이드의 예시와 동일한 형식인 첫 글자를 대문자로 사용하는 명명법을 사용합니다.
DECLARE Counter : INTEGER
Counter ← 0
Counter ← Counter + 1
OUTPUT Counter
English
DECLARE, then the arrow
DECLARE Counter : INTEGERcreates the variable and names its type.- The assignment operator is
←. It stores the value on the right. =is not how you store a value.=means "is equal to" inside a test.
한국어
DECLARE(선언)를 먼저, 그 다음 화살표를
DECLARE Counter : INTEGER는 변수를 생성하고 그 타입을 지정합니다.- 대입 연산자는
←이며, 오른쪽에 있는 값을 저장합니다. =는 값을 저장하는 방법이 아닙니다.=은 조건문 내에서 "같다"라는 의미를 가집니다.
DECLARE Score : INTEGER
Score ← 40
Score ← Score + 2
OUTPUT Score
English
Watch out
- Declare a variable before you use it.
- An identifier starts with a letter. Digits may follow. The guide also allows
_.
한국어
주의사항
- 변수를 사용하기 전에 먼저 선언해야 합니다.
- 식별자는 문자로 시작하며, 뒤에 숫자가 올 수 있습니다. 이 가이드에서는
_도 허용합니다.
English
Common mistakes
Counter ← 1stores 1.Counter = 1is not an assignment.- One variable holds one value. Assigning again replaces it.
한국어
흔한 실수
Counter ← 1는 1을 저장합니다.Counter = 1는 할당문이 아닙니다.- 하나의 변수는 하나의 값을 가집니다. 다시 할당하면 기존 값이 교체됩니다.
English
Now you try
- Declare an integer, store a value with
←, and output it.
한국어
이제 직접 해보기
- 정수(integer)를 선언하고,
←을 사용하여 값을 저장한 뒤 출력합니다.
Declare Total as an INTEGER, store 8, and output it. · Total을 INTEGER로 선언하고, 8을 저장하며, 이를 출력하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Declare Counter as an INTEGER. Start it at 0, add 1, and output it. · Counter을 INTEGER로 선언하십시오. 0으로 시작하여 1을 추가하고, 이를 출력하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.