Love Every Moment

〔모두를 위한 파이썬〕예약어, 순차문, 조건문, 반복문 본문

PROGRAMMING::LANGUAGE/Python

〔모두를 위한 파이썬〕예약어, 순차문, 조건문, 반복문

해 송 2021. 4. 20. 15:22
반응형

컴퓨터 프로그래밍 코딩 교육

 

 

1. 예약어(Reseverd Word)

  • You cannot use Reserved Words as variable names / identifiers
  • ex) True, False, class, return, is, finally, none, if, else, for, while, continue, def, from, and, not, or, ...

 

  • x = 2   ← Assignment statement
  • x = x + 2   ← Assignment with expression
  • print(x)  ← Print statement

 

x : 변수(Variable)

= : 연산자(Operator)

2 : 상수(Constant)

print() : 예약어(Reserved Word)

 


 

스크립트 사용 예시

 

2. Programming Paragraphs

 

(1) 상호대화식(Interactive)

  • 커맨드라인에서 코드를 한줄씩 실행
  • 코드가 길어질 경우 복잡해지므로 보통 사용하지 않음
  • You type directly to Python one line at a time and it responds

 

(2) 스크립트식(Script)

  • 코드가 길어질 경우 코드를 한번에 작성하는 스크립트가 유리
  • 파일명을 저장할 때에 .py 의 형식으로 저장해준다
  • You enter a sequence of statements into a file using a text editor and tell Python to execute the statements in the file

컴퓨터 프로그래밍 코딩 교육


 

3. Program Steps(=Program Flow)

 

 

 

(1) 순차문(Sequential Steps)

It flows from one step to the next.

 

(2) 조건문(Conditional Steps)

Let's run this code if the statement is TRUE.

 

(3) 반복문(Repeated Steps)

Loops have iteration variables that change each time through a loop.

Let's run this code while the statemnet is TRUE.

 


 

강의 사이트

 

모두를 위한 파이썬 (PY4E)

부스트코스 무료 강의

www.boostcourse.org

 

반응형
Comments