AIFFEL Day 2

Serena Chang·2021년 12월 29일
0

AIFFEL

목록 보기
2/8
post-thumbnail

LMS & Python Master Day 2

What I've learned

  1. encoding vs decoding

  2. chr() and ord()

  3. join(), split(), replace()

  4. regular expression a.k.a regex

  5. for, while, break, continue loop statements

1. encoding vs decoding

encoding : convert strings to bytes

decoding : convert bytes to strings

There are variety of UTF such as UTF-8, UTF-16 and so on. UTF-8 is the most commonly used because of its conveniences.
Unicode HOWTO

Encoding and decoding can be easily done by using str.encode() and str.decode(). If you don't set which UTF you will use, it will automatically use UTF-8 as Python often defaults to using it.

2. chr() and ord()

chr(): used for converting an Integer to a Character

ord(): used to do the reverse, i.e, convert a Character to an Integer.

3. join(), split(), replace()

join():

split():

replace():

4. regular expression a.k.a regex

pattern

5. for, while, break, continue loop statements

profile
new to Python and everything

0개의 댓글