Your first program · 첫 번째 프로그램
Welcome
- Python follows your instructions, one line at a time.
- You write code here and run it — nothing to install.
- Read each step, then press Continue.
환영합니다
- Python은 명령을 한 줄씩 따릅니다.
- 여기서 코드를 작성하고 실행할 수 있습니다. 설치할 것이 없습니다.
- 각 단계를 읽고 계속하기를 누르세요.
Show text with print
print(...)shows text on the screen.- Put the text in quotes:
"...". - Each
printstarts a new line.
print으로 텍스트 표시하기
print(...)은 화면에 텍스트를 보여줍니다.- 텍스트를 따옴표 안에 넣으세요:
"...". - 각
print은 새 줄에서 시작합니다.
print("Welcome to Python!")
print("This line runs next.")
Strings
- Text in quotes is called a string.
- You can use double quotes
"..."or single quotes'...'. - You can also print a number with no quotes, like
print(42).
문자열
- 따옴표 안의 텍스트를 문자열이라고 합니다.
- 이중 따옴표
"..."이나 단일 따옴표'...'을 사용할 수 있습니다. - 또한, 따옴표 없이 숫자를 출력할 수도 있습니다. 예:
print(42).
Comments
- A line that starts with
#is a comment. - Python ignores comments — they do not run.
- Use them to leave notes for people who read your code.
주석
#으로 시작하는 줄은 주석입니다.- Python은 주석을 무시하므로 실행되지 않습니다.
- 코드를 읽는 사람들을 위해 메모를 남길 때 사용합니다.
# This line is a note for people. Python skips it.
print("Comments do not show.")
Common mistakes
printneeds quotes around text:print("Hi"), notprint(Hi).- Python is case-sensitive:
Printis not the same asprint.
흔한 실수
print은 텍스트 주변에 따옴표가 필요합니다:print("Hi"),print(Hi)처럼.- Python은 대소 문자를 구분합니다:
Print와print은 다릅니다.
Now you try
- Below are a few tasks. Type your code and press Run.
- Press Check answer to see if it is correct.
이제 직접 해보기
- 아래에 몇 가지 작업이 있습니다. 코드를 타이핑한 후 실행을 누르세요.
- 정답 확인을 눌러 정답인지 확인하세요.
How a program runs · 프로그램 실행 방식
A program runs top to bottom, one statement at a time. · 프로그램은 위에서 아래로, 한 줄씩 순서대로 실행됩니다.
Use print(...) to make Python show the words Hello, world! exactly (same spelling, same punctuation). · Python이 **Hello, world!**라는 단어를 정확히(동일한 철자와 동일한 부호) 표시하도록 print(...)를 사용하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Print two lines. The first line must be My name is Pat. The second line must be I am learning Python. (Use two print(...) calls.) · 두 줄을 출력하십시오. 첫 줄은 반드시 My name is Pat여야 합니다. 두 번째 줄은 반드시 I am learning Python여야 합니다. (두 번의 print(...) 호출을 사용하십시오.)
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Keep the comment line, then print the number 42. Notice the comment never appears in the output. · 주석 줄을 유지한 채로, 숫자 42를 print에 저장하십시오. 주석이 출력 결과에 절대 나타나지 않는 것을 확인하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Print a box made of three lines: first +-----+, then | Hi! |, then +-----+ again. · 세 줄로 이루어진 상자를 출력하십시오: 먼저 +-----+, 다음에 | Hi! |, 그리고 다시 +-----+.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.