본문 바로가기

분류 전체보기

(123)
week3-python 기본미션 - 리스트, 딕셔너리 이해 리스트 ar = ['apple', 'banana'] 'banana' in ar ar.index('banana') ar.count('banana') ar[0] = 'orange' # 수정 append() insert() del ar[0] # 삭제 pop() remove() ar.extend(['mango']) for i, x in enumerate(ar): if all(len(x) > 5 for x in ar): if any(len(x) > 5 for x in ar): 딕셔너리 d = {'apple': 20, 'banana': 10} # 리터럴 초기화 d = dict(apple=20, banana=10) # dict 초기화 d['apple'] = 30 # 추가/수정 de..
week3-java 기본미션 - 노트활용 빠르게 읽으며 복습에 활용 chapter 10 - chapter 11 string String str; str = "Hello"; str += "World"; int idx = str.indexOf("World"); // (없으면 -1) str = str.replace("Hello", "123"); // 123World str = str.substring(0, 3); // 123 String[] arr = str.split(""); str = String.join("", arr); for (char ch: str.toCharArray()) if (str.equals("123")) 표준 라이브러리 long start = System.currentTimeMillis(); Thread.s..
week3-javascript [기본미션] - 파괴적 처리: 원본을 파괴하는 처리 const ar = [2, 1] ar.sort() // ar = [1, 2] - 비파과적 처리: 원본을 유지하는 처리 const ar = [2, 1] const a2 = [...ar] // ar = [2, 1] [학습내용] chapter 04 반복문 // Array loop for (const i in arr) for (const x of arr) for (const [i, x] of arr.entries()) // Object loop for (const key in obj) for (const [k, v] of Object.entries(obj)) week3 https://big-mango.tistory.com/152 week2 https://big..
week2-python 기본미션 - p187 3번 문제 chapter03 조건문 result = True if 2 > 1 else False 반복문 odd = [i for i in range(1, 10) if i % 2 == 1]
week2-java 기본미션 - p330 5번 문제 자식 기본 생성자 호출 → 자식 생성자 호출 → 부모 기본 생성자 호출 → 부모 생성자 호출 Child() call ← Child(String name) call ← Parent() call ← Parent(String nation) call chapter 06-chapter 09 클래스 class Person { private String name; // 필드 private int age; // 필드 public Person(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public int getAge() { return age; } } ..
week2-javascript [기본미션] p139 3번 문제 [학습내용] chapter 03 조건문 let age = Math.floor(Math.random() * 20) + 1 // if if (age < 18) n = 0 else n = 1 // switch switch (Math.floor(age / 9)) { case 0: case 1: n = 0 break; default: n = 1 } // conditional operator age = age !== undefined ? age : 20 age = age || 20 week3 https://big-mango.tistory.com/152 week2 https://big-mango.tistory.com/149 week1 https://big-mango.tistory.co..
week1-python 기본미션 - p101 3번, 4번, 5번 문제 5행에서 IndexError chapter01 - chapter02 자료형 nu = 10_000_000 # 숫자 int float st = 'three' # 문자 chr str bo = False # 불린 bool li = [1, 2, 3, 4] # list tu = (1, 2, 3, 4) # tuple se = {1, 2, 3, 4} # set di = {'name': 'gy', 'age': 4} # dict number n = 1 print(f"{n:05d}") # 00001 a = 12.355 print(f"{a:5.1f}") # 12.4 n = 10 a = 0b1010 # 10, int b = 0o12 # 10, int c = 0xA # 10, int..
week1-java 기본미션 - JDK 설치 화면 인증하기 chapter 01-chapter 05 자료형 int n = 1; // 정수 byte short int long(L) double d = 1.0; // 실수 float(f) double char c = 'a'; // 문자 char String s = "hi"; // 문자열 String boolean b = false; // 불 boolean System.out.printf("%d %f %c %s %b \n", n, d, c, s, b); System.out.println(n); System.out.print(n); 형변환 d = 1 + 1.0; // 작은숫자 + 큰숫자 s = 1 + "2"; // 숫자 + 문자열 d = n; // 작은숫자 -> 큰숫자 n = (in..