Update page 'Day 1 homework - Xuanyi Wang (Sloetjes)'

xuanyi.wang
2023-03-31 00:08:17 +02:00
parent 8a6e1d2ca9
commit 8c64dd63fc
+1 -1
@@ -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.