(Basics 02) 첫 번째 프로그램

SoloLearn Python 번역


  • Let’s start off by creating a short program that displays “Hello World”.
    • “Hello World”를 표시하는 간단한 프로그램을 생성하는 것으로 시작해보자.
  • In Python, we use the print statement to output text:
    • Python에서는 print 문을 사용해서 텍스트를 출력한다.
>>> print('Hello World')

# Hello World

코드 실행 확인


>>> are the prompt symbol of the Python console.

>>>는 Python 콘솔의 prompt 심볼이다.

Python is an interpreted language, which means that each line is executed as it is entered.

Python은 해석형 언어이므로, 각 줄이 입력될 때 실행된다.

Python also includes IDLE, the integrated development environment, which includes tools for writing and debugging entire programs.

Python에는 통합 개발 환경인 IDLE도 포함되어 있다.

전체 프로그램을 작성하고 디버깅하기 위한 툴도 포함한다.


Printing Text

텍스트 출력하기


  • The print statement can also be used to output multiple lines of text.
    • print 문은 여러 줄의 텍스트를 출력하는 데 사용할 수도 있다.
>>> print('Hello World')
>>> print('Hello World')
>>> print('Spam and eggs')

# Hello World
# Hello World
# Spam and eggs

코드 실행 확인


Python code often contains references to the comedy group Monty Python.

Python 코드는 종종 코미디 그룹 Monty Python에 대한 참조를 포함한다.

참조: 나무위키 몬티 파이썬 스팸

This is why the words, “spam” and “eggs” are often used as placeholder variables in Python where “foo” and “bar” would be used in other programming languages.

그렇기 때문에 Python에서는 “spam”과 “eggs”라는 단어가 placeholder(Input Prompt) 변수로 종종 사용된다.

다른 프로그래밍 언어에서는 “foo”와 “bar”가 사용된다.



QUIZ

  • Fill in the blanks to print “Hi”.
    • “Hi”를 출력해라.
>>> print('Hi')


  • Fill in the blank to output “How are you?”.
    • “How are you?”를 출력해라.
>>> print('How are you?')