본문 바로가기
IT World/Python

Python Training Day5. Basic Operators

by 닷라인웨이 2022. 12. 8.

퇴근하고 집에와서 저녁을 다 먹기까지 1시간 정도가 소요되고, 그 뒤에 나의 일을 한다. 하루 중 눈 뜨고 있는 시간이 17~20시간이다. 그러다보니 피곤한 상태인데 피곤한 줄도 잘 모르는 일종의 각성? 상태로 살고 있다. 그 근거는 어제도 Python 훈련을 하지 못한 것과 같다. 잠깐만 누워있다가 일어나서 할 거 하자고 잠깐 누우면 그대로 잠들어버려 아침까지 자버리는 것이다. 매일 무언가를 한다는 건 정말 어려운 일이다. 습관으로 만들 때까지 더 독해져야 한다.

 

그리고 정리를 해가며 공부하는 것은 정말 일이다. 그렇다고 정리를 안 하고 눈으로 쓱 보고 문제 다 풀었다고 넘겨버리면 안 된다. 인간은 망각의 동물이기 때문에, 기록해야 한다.


 

Chapter 3. Basic Operators (learnpython.org)

 

Arithmetic Operators

Just as any other programming languages, the addition, subtraction, multiplication, and division operators can be used with numbers.

Another operator available is the modulo (%) operator, which returns the integer remainder of the division. dividend % divisor = remainder.

Using two multiplication symbols makes a power relationship.

 

Using Operators with Strings

Concatenating strings using the addition operator.

Multiplying strings to form a string with a repeating sequence.

 

Using Operators with Lists

Lists can be joined with the addition operators.

Forming new lists with a repeating sequence using the multiplication operator.

 

 

 

밀린 1개는 내일 2개 해서 정산하려 한다. 오늘은 1개만 풀었다. 이 사이트가 자주 이러는지는 모르겠는데 접속이 계속 안 되어서 시간 낭비가 발생했기 때문이다.

댓글