오늘도 공부한 내용 정리시작!!
https://wook-2124.tistory.com/8
[Python] #1.0 Date Types of Python
https://youtu.be/9GYDSEMvppU 오늘부터 유튜버 Nomad Coders, 니꼴라스님의 무료 강의로 파이썬 공부시작!! 1. 준비물 https://repl.it/ The world's leading online coding platform Powerful and simple online..
wook-2124.tistory.com
저번에 공부한 내용 알고싶으신 분은 위 링크 클릭!
https://docs.python.org/3/library/
The Python Standard Library — Python 3.8.1 documentation
The Python Standard Library While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python. It also describes some of the opt
docs.python.org
The world's leading online coding platform
Powerful and simple online compiler, IDE, interpreter, and REPL. Code, compile, and run code in 50+ programming languages: Clojure, Haskell, Kotlin (beta), QBasic, Forth, LOLCODE, BrainF, Emoticon, Bloop, Unlambda, JavaScript, CoffeeScript, Scheme, APL, Lu
repl.it
오늘의 준비물!!
1. print(type(days)) - string(str)_Text Sequence Type
저번에 했던 내용의 반복일 수도 있지만 str은 string_Text Sequence Type이다.
전체의 내용을 "_________"로 묶으면 str가 된다! ("안에 들어가있는 모든 문자는" 문자열이라는 소리!!)
2. print(type(days)) - tuple_((연결형)) 「…개의 요소로 된 집합」의 뜻_Sequence Types
tuple은 "__", "__" 처럼 비슷하게 적어도 묶이지만 ("__", "__") 처럼 ()을 이용해서 묶게되면 tuple로 묶이는 것을 알 수 있다.
3. print(type(days)) - list(목록, 명단)_Sequence Types
list는 []로 묶으면 된다!!
정리하자면
"_______" = str
("_____") = tuple
["_____"] = list
4. Common Sequence Operations
Common Sequence Operations은 값 변경이 되지않는(Immutable) 보통의 시퀀스를 말한다.
5. x in s, x not in s - something in sequence, something not in sequence
x in s - something in sequence_'Mon' (True)
"Mon" in days = True
x in s - something in sequence_'Man' (False)
"Man" in days = False
어떻게 이해좀 되셨나요?! x는 something 으로 입력하는 값, 그리고 s는 sequence의 약자로 입력하는 함수!
반대로 해볼까요?!
x not in s - something not in sequence_'Mon' (False)
"Mon" not in days = False
x not in s - something not in sequence_'Man' (True)
"Man" not in days = True
오케이!! 갓챠!
6. s[i] - sequence[item]
origin 0이라고 적혀있는 것도 볼 수 있는데, 이건 컴퓨터는 0부터 숫자를 센다고 생각하면 된다!
그래서 s[i] - days[3]을 넣으면 0, 1, 2, "3"에 위치한 Thur가 나오는 것이다.
7. les(s) - length(sequence)
length(길이)를 7개로 읽는다... 개수를 세는구만!
8. min,max(s) - min,max(sequence)
몇 개만 더 해보자!!
print(min(days)), 여기서 min(최소)는 abcdefghijklmnopqrstuvwxyz 에서 가장 왼쪽에 있는 a가 제일 작은거라고 생각하면 된다!(문자로 생각)
떄문에 Fri "F"가 가장 작다고 나오는 것이다.
print(max(days)) - Wed도 마찬가지로, abcdefghijklmnopqrstuvwxyz 에서 가장 오른쪽에 있는 z가 가장 큰거라고 생각하고 "W"가 가장 max로 뜬것으로 생각하면 된다.
9. Mutable Sequence Types (Mutable - 값 변경 가능 뜻)
변동되는 예시도 알아보자!
s.append(x) - sequence.append(something) (append - 덧붙이다, 첨부하다)를 대입해보자!
sequence.append(something) - day.append("Break time")를 입력하면 오른쪽 터미널에서 Break time이 추가되는 것을 알 수 있다.
s.reverse() - sequence.reverse()와 s.remove(x) - sequence.remove(something)도 입력해보자!
reverse - (정반대로) 뒤바꾸다, 반전시키다 / remove - (어떤 곳에서) 지우다
s.reverse() - days.reverse()를 입력하니까 오른쪽 터미널에 값들이 뒤집혀서 출력된 것을 알 수 있다!
거기에 s.remove(x) - days.remove("Mon")...!! 대부분의 사람들이 싫어하는 Mon을 없애준 값을 입력하면
Mon이 빠지고 값이 reverse된 것을 알 수 있다.
"Break time"이 append(추가)되고, 값들을 reverse(뒤집)고, "Mon"을 remove(지워)버렸다!!!!
오늘은 니꼴라스쌤의 강좌 하나를 통해 정말 많은 내용을 공부한거 같다.
또 https://docs.python.org/3/library/
The Python Standard Library — Python 3.8.1 documentation
The Python Standard Library While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python. It also describes some of the opt
docs.python.org
위 사이트를 통해서 무료로 연습해볼 수 있다는 것을 알 수 있었고 계속해서 복습하며 내 것으로 만들어야겠다..!!
화이팅!
'Python > Web Scraping' 카테고리의 다른 글
[Python] #1.5 Function Arguments (#코딩공부) (0) | 2020.02.02 |
---|---|
[Python] #1.4 Creating a Your First Python Function (#코딩공부) (0) | 2020.02.02 |
[Python] #1.3 Built-in Functions (#코딩공부) (0) | 2020.01.31 |
[Python] #1.2 Tuples and Dicts (#코딩공부) (0) | 2020.01.31 |
[Python] #1.0 Date Types of Python (#코딩공부) (0) | 2020.01.28 |
댓글