Oct-30-2018, 03:00 AM
In addition, there should be a colon at the end of the if statement:
Furthermore, your quote characters are not actually quote characters. They're some sort of weird multi-byte horror, similar to the trash Microsoft Word frequently replaces quotes for. To demonstrate, here's a single quote character
if len(mystr) < 6:
.Furthermore, your quote characters are not actually quote characters. They're some sort of weird multi-byte horror, similar to the trash Microsoft Word frequently replaces quotes for. To demonstrate, here's a single quote character
x
, and the two different make-believe nonsense characters you had (they are NOT the same, and it DOES matter):>>> x = "'" >>> x.encode() b"'" >>> y = "‘" >>> y.encode() b'\xe2\x80\x98' >>> z = '’' >>> z.encode() b'\xe2\x80\x99'