티스토리 뷰
반응형
리스트에 있는 모든 string 을 int 로 변경하기
Python 3.
map() 에서는 map 객체로 반환하기 때문에 마지막에 한번더 list 로 type 변경해줄 필요가 있다.
Python 2.
map 에 원하는 type 과 함께 넣고 변경하면 된다.
자료출처 :
https://stackoverflow.com/questions/7422453/python-change-type-of-whole-list
끝.
'Django(장고) > Django Q&A' 카테고리의 다른 글
django - 새로운 장고앱 만들기 (0) | 2020.12.14 |
---|---|
django 프로젝트 시작 - 가상환경 및 프로젝트 폴더 설정하기 (0) | 2020.12.13 |
Django - request.POST 여러개 선택된 checkbox 값 읽어오기 (0) | 2020.04.07 |
Django - objects 의 get() 와 filter() 차이점 (0) | 2020.04.07 |
장고 Textfield 에 개행 문자 넣기 (Insert newline in Django form) (0) | 2020.04.07 |
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- django
- cmd
- 미밴드
- 환경설정
- 프로젝트
- 미밴드4
- development
- cmd창
- 윈도우
- 프로젝트 생성
- Python
- Karabiner-Elements
- END key
- 한글패치
- Quiz
- vscode
- venv
- Windows
- 파이썬
- 가상환경
- HOME key
- angular
- win7
- cmd실행
- amaztools
- Windows7
- 장고
- web
- HOME/END
- win10
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함