Declare Character Encoding Python

underlying string variable. We have a string variable, sex, that records each person’s sex as “male” and “female”. Because female has six characters, the variable is stored as a str6. We can encode the sex variable and use compress to store the variable as a byte, which takes only 1 byte. ................
................