Development/Python(797)
-
실행 - PyCharm
실행하기 OK OK
-
설치 - PyCharm
설치하기 설치완료!!! Finish
-
수치 - complex
수치 int float complex complex 복소수는 j를 사용해서 표현 >>> x=3-5j >>> type(x) >>> x.imag #허수부 -5.0 >>> x.real #실수부 3.0 >>> x.conjugate() #켤레복소수 (3+5j) >>> type(x), x.imag, x.real, x.conjugate() (, -5.0, 3.0, (3+5j)) ※켤레 허수 부분의 부호를 바꾼 것을 켤레 예를 들어 a, b가 실수라 할 때 임의의 복소수 x = a+bi가 있다면 이 수의 켤레는 x* = a-bi가 됩니다.
-
수치 - float
수치 int float complex float >>> type(3.14) >>> type(314e-2) #지수표현
-
자료형
자료형 데이터 형(data type)이라고도 합니다. 데이터의 유형을 정의합니다. 자료형에는 문자와 숫자등이 있습니다. 데이터 타입 확인하기 >>> 10 10 >>> type(1) >>> type(3.14) >>> abcdefg Traceback (most recent call last): File "", line 1, in NameError: name 'abcdefg' is not defined >>> print('abcdefg') abcdefg >>> print('python') python >>> type('python') >>> print('안녕하세요') 안녕하세요 >>> type('안녕하세요') >>> type(u'안녕하세요') 타입확인이 중요한 이유 정수형과 정수형의 연산시 결과도 정수형으로 ..
-
ex01-주석
주석 소스코드 result = 'Hello' + 'pyhon' print(result) result = 'Hello' + 'pyhon' + 'world' print(result) # 행단위 주석 result = 'Hello' + 'pyhon' #+'world' print(result) result1 = 'Apple' result2 = '사과' result = result1 + result2 print(result) # 블럭단위 주석 ''' result1 = 'Orange' result2 = '오렌지' result = result1 + result2 print(result) ''' 출력결과