Light Blue Pointer
본문 바로가기
Developing/개발일지

2023-10-23 Today I learned

by Greedy 2023. 10. 23.

⭐(복습)파이썬 배열 초기화

arr = [0 for i in range(rows)]

⭐파이썬 배열(리스트) 원소 추가

⚠️ index를 모르는 상태로 for문 돌리면서(i,j 말고 x,y로) answer에 저장하려니 append써야 했음

arr.append(value)
arr.insert(index,value)

(복습) 키값이 존재하는지 보기

if "model" in thisdict:
  print("Yes, 'model' is one of the keys in the thisdict dictionary")

그리고 딕셔너리를 획기적인 방법으로 넣어버림

dictionary = dict(zip(name,yearning))

Java Map에서 get()을 호출해서 찾을때 Map에 키가 없는 경우에 null을 return한다

import java.util.Map;
import java.util.HashMap;

containsKey로 키가 있는지 찾아볼 수 있다, 나처럼 null인지 비교 안 해도 됨

if(map.containsKey(person))

'Developing > 개발일지' 카테고리의 다른 글

2023-10-30 Today I Learned  (1) 2023.10.30
2023-10-25, Today I Learned  (0) 2023.10.27
2023-10-20 Today I Learned  (1) 2023.10.20
2023-10-19, Today I Learned  (1) 2023.10.19
2023-10-10, Today I Learned  (0) 2023.10.10