From 8c64dd63fc335dd4e67ae46fc92cb03463f84e66 Mon Sep 17 00:00:00 2001 From: "xuanyi.wang" Date: Fri, 31 Mar 2023 00:08:17 +0200 Subject: [PATCH] Update page 'Day 1 homework - Xuanyi Wang (Sloetjes)' --- Day 1 homework - Xuanyi Wang (Sloetjes).md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Day 1 homework - Xuanyi Wang (Sloetjes).md b/Day 1 homework - Xuanyi Wang (Sloetjes).md index 493d663..57ac2f9 100644 --- a/Day 1 homework - Xuanyi Wang (Sloetjes).md +++ b/Day 1 homework - Xuanyi Wang (Sloetjes).md @@ -79,7 +79,7 @@ Therefore, any calculation involving adding 0.01 to a dollar amount smaller than #### 7. Name three practical differences between Python strings and bytes. Using sys.getsizeof, see how the sizes may be different. Do emoji change this answer? -** Encoding**: Python strings are used to represent text data, while bytes are used to represent binary data. Strings are typically encoded using a character encoding such as UTF-8 or ASCII, which maps each character to a sequence of bytes, while bytes represent raw binary data that may not necessarily correspond to any particular character encoding. +**Encoding**: Python strings are used to represent text data, while bytes are used to represent binary data. Strings are typically encoded using a character encoding such as UTF-8 or ASCII, which maps each character to a sequence of bytes, while bytes represent raw binary data that may not necessarily correspond to any particular character encoding. **Immutability**: Python strings are immutable, meaning that once a string is created, its contents cannot be changed. In contrast, bytes are mutable, meaning that their contents can be changed after they are created.