파이썬연산자
-
Python Chapter02방뚝딱 학습노트 2023. 8. 5. 08:07
교재 : 멘토씨리즈 파이썬 format() 메소드(60p) 형식에 맞춰 연락처 정보를 출력하는 프로그램 연락처 {0}-{1}-{2} 순서대로 표시되며, 명시한 모든 번호는 생략할 수 있습니다. 입력함수 input() 함수명() 입력함수 : 키보드(표준 입력장치로 부터 값을 입력받을 때 사용한다.) 변수명 = input(’’); print(변수명) input함수는 모든 입력을 문자열로 저장한다. 예제1) 예제2) 연산자 연산 기능이 있는 문자 ex)식 : 2+3 연산자 : + 피연산자, 항 : 2,3 1. 산술연산자 +, - , *, / , //, %, ** // : 나눗셈을 하고 몫만 가져온다. % : 나눗셈을 하고 나머지만 가져온다. ** : 제곱연산자 2. 복합대입연산자 변수에 값을 저장하기 위해서 ..