Python
-
변수와 출력Python 2023. 9. 20. 17:09
변수 특수문자는 사용 불가능하지만 _(밑줄)은 사용 가능 수학에서는 =(등호) 기호는 양변이 같다는 뜻이지만 프로그래밍 언어에서는 변수에 값을 할당한다는 의미 수학의 등호와 같은 역할을 하는 연산자는 == 출력 방법 문자열 > 자료형 변환, 계산 방법 결과 값으로 정수 출력 원할 경우 print 안에 int 넣는 것 잊지 말 것 넣지 않을 경우 오른쪽 사진처럼 소수점 이하 자리가 같이 출력되게 됨 왼쪽은 명령 크롬프트 창, 오른쪽은 IDLE의 소스 파일 편집 후 실행 기능 이용한 결과 값
-
파이썬 기초Python 2023. 9. 18. 17:56
파이썬 설치, 시작 시작 메뉴 실행 후 Python 3.11> IDLE(Python 3.11 (64-bit) 실행 한 줄 한 줄 파이썬 코드 입력해 결과를 얻는 방식, 인터프리터 방식 파이썬 코드 직접 입력하여 실행하는 프로그램, 파이썬 셸 ex) IDLE IDLE은 파이썬 셸을 통해 바로 결과를 볼 수 있고, 소스 파일 편집 후 실행하는 기능 함께 제공 소스 파일 실행 1. IDLE 실행 후 File - New File (Ctrl + N) 2. 코드 입력 후 저장 Ctrl + S (저장 형식 .py) 3. RUN - RUN Module (F5) > 실행 IDLE 없이 명령 프롬프트에서 스크립트 파일 진행 가능 1. Wins + R 누른 뒤 cmd 입력 2. python 입력 시 파이썬 셸 실행 가능 기..