-
[Java] 자바의 자료형
1. 정수 자료형 Java의 정수 자료형에는 byte, short, int, long 이 있습니다. 자료형 크기 범위 byte 1byte -2^7 ~ (2^7 -1) short 2byte -2^15 ~ (2^15 -1) int 4byte -2^31 ~ (2^31 -1) long 8byte -2^63 ~ (2^63 -1) byte: 1byt... Read More
-
Bit와 Byte 정리하기
Bit 와 Byte Bit: 정보를 표현하는 최소 단위 컴퓨터는 0과 1 두 가지 숫자만으로 모든 데이터를 구성합니다. 이 때 구성되는 0또는 1을 Bit(Binary digit) 라고 합니다. 직역하면 “이진법의 수” 입니다. Byte: 데이터의 양을 표현하는 단위 1byte = 8bit 이며 Byte 는 8개의 bit를 의미합니다. 1byte 는 8개의 bit가 on/off 의조합을 만들어 수를 표현하기 때문에 \(2^8 = 256\)개의 숫자를 표현할 수 있습니다. 숫자에는 양수와 음수가 있기 때문에 이를 고려하면 Byte는 -2^7 ~ (2^7-1)까지의 값을 가질 수 있습니다. 정리하면 아래... Read More
-
[Collections] 파이썬 Counter 정리하기
Counter 정의 Counter클래스는 자료의 개수를 구하는 Collections모듈의 클래스입니다. ※Counter는 리스트 뿐만 아니라 딕셔너리,문자열,튜플 등 반복가능한 개체를 인자로 받을 수 있습니다. Counter와 count Counter 클래스와 count함수는 둘 다 자료의 개수를 알려주는 함수입니다.두 개의 차이점은 count 함수는 특정 원소의 개수를 알려주지만 Counter클래스는 각각 원소들이 몇 개씩 있는지 전부 알려준다는 것입니다 예제를 통해서 알아보겠습니다. ※참고:count 함수 정리하기 from collections import Counter fruits = ['... Read More
-
네이밍 컨벤션(Naming Convention) 정리하기
네이밍 컨벤션(Naming Convention)이란? 네이밍 컨벤션(Naming Convention)은 변수,클래스,모듈과 같은 프로그래밍 구성 요소의 이름을 작성하는 방법입니다. 네이밍 컨벤션을 이용하면 프로그래밍 구성요소들을 더 쉽게 사용할 수 있고 쉽게 찾을 수 있습니다. 네이밍 컨벤션의 대표적인 예시로는 camelCase,PascalCase,snake_case가 있습니다. 1.camelCase camelCase는 소문자로 단어를 시작해서 중간에 단어가 바뀔 때 마다 단어의 첫 글자를 대문자로 바꾸는 방법입니다. camelCase 예시 numberOfStudent 2.PascalCase Pasca... Read More
-
[Python] 파이썬 개발환경 설정3
가상환경을 만드는 이유 프로젝트를 진행하다보면 프로젝트에 사용되는 파이썬 버전이랑 최신 파이썬 버전이 달라지게 됩니다. 이러한 경우 기존에 프로젝트에 사용되던 파이썬 버전을 업그레이드 하게 되면 파이썬 버전이 바뀌면서 기존에 사용되던 명령어가 새로운 버전에서 작동하지 않을 수도 있습니다. 뿐만 아니라 파이썬 모듈 및 패키지도 특정 버전에서만 지원되는 경우가 있기 때문에 프로젝트 별로 가상환경을 만들어서 파이썬 버전을 관리하는 것이 좋습니다. 파이썬 가상환경의 종류 파이썬 가상환경 종류에는 다양한 가상환경 모듈 및 패키지가 존재합니다. 그 중 많이 사용되는 대표적인 두 개의 가상환경에 대해서 설명하겠습니다. ... Read More