Python Script 쓸때 Research 잘 해야함
input will be event class
event랑 evolved 되어잇는 모든 elements
sorted() , return the new list it's sorted
sort fucntion 쓰면, 리스트안 value 들 값 순서대로 정리함, 정의 되어있는 벨류값을 바꾸진 않음
key 쓰면 sort 할때 어떤 기준으로 정렬 할지 알려주는거?
sort() Parameters
By default, sort() doesn't require any extra parameters. However, it has two optional parameters:
- reverse - If True, the sorted list is reversed (or sorted in Descending order)
- key - function that serves as a key for the sort comparison
sort() function will modify the list it is called on. The sorted() function will create a new list containing a sorted version of the list it is given. ... The sort() function modifies the list in-place and has no return value.
sorted == 원본을 유지하고 새로운 a를 가져와 사용함
sort == 원본을 변경함, 원본 남지 않음
set function 써서, log in time, log out time record 하는 script 를 만들어 봅시다
Scripting 할때 def function 은 최대한 많이 만들고 쉽게 쓸수 있게 Planning 하는게 좋은 습관이다.
왜냐? fixing bug 랑 recurring 하는 function 들을 잘 쓸수 있도록 미리 가이드라인을 만들어놓으면 추후에 훨씬 편하기 때문
attribute == ~의 결과로 보다
'Service > Coding' 카테고리의 다른 글
Quiz: Week 4 - Python (0) | 2022.02.15 |
---|---|
Quiz 3 week - Python (0) | 2022.02.15 |
Google Python Automation Certification - Week 5 (0) | 2022.02.05 |
Google Python Automation Certification - Week 4 (0) | 2022.02.03 |
Google Python Automation Certification - Week 3 (0) | 2022.02.02 |