배워서? 남줘라!

[Python] #1 IDLE 본문

Computer languages/Python

[Python] #1 IDLE

developing 2022. 10. 4. 15:22

Python IDLE(Integrated Development and Learning Environment) 에디터 사용하기

   1.     윈도우창에서 IDLE python 실행하면 shell 창이 켜진다.

   2.     File → New File 누르면 IDLE 에디터 창이 켜진다.

   3.     에디터 창에 원하는 명령어 입력하고 [F5]로 실행 → Shell 창에 결과값이 나온다.

   4.     처음 실행시킬 때에는 저장 알림이 뜨고 원하는 위치에 .py로 저장한다.

 

 

(왼)IDLE shell 창, (오)IDEL editor 창

 

# if

a=5
if a>2:
    print('a is greater than 2')
# for

for a in [5,3,7]:
    print(a)
# while

a=0
while a<5:
    a=a+1
    print(a)
# def

def add(a,b):
    return a+b

print(add(1,2))

 

<참고>

박응용 저, Do it! 점프 투 파이썬, 이지스퍼블리싱, 2019

 

'Computer languages > Python' 카테고리의 다른 글

[Python] #6 if, while, for  (0) 2022.10.09
[Python] #5 Bool & Variables  (0) 2022.10.07
[Python] #4 Dictionary & Set  (1) 2022.10.07
[Python] #3 List & Tuple  (1) 2022.10.06
[Python] #2 Number & String data type  (1) 2022.10.06
Comments