@googlefactss · Post #40935 · 15.04.2026 г., 16:32
Emoji” is derived from three Japanese words: “e” for picture, “mo” for write, “ji” for character. @googlefactss#funfact
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #242 · 7 мај
Теперь запакуем строку. В этом случае следует передавать тип данных bytes. >>> struct.pack('=s', b'a') b'a' Для записи слова следует указывать количество символов. >>> struct.pack('=5s', b'hello') b'hello' Кстати, запакованный вид соответствует исходному тексту. Всё верно, символ есть в таблице ASCII, то есть его код попадает в диапазон 0-127, он может быть записан одним байтом и имеет визуальное представление. А вот что будет если добавить символ вне ASCII >>> struct.pack(f'=s', b'ё') SyntaxError: bytes can only contain ASCII literal characters. Ошибка возникла еще на этапе создания объекта bytes, который не может содержать такой символ. Поэтому надо кодировать эти байты из строки. >>> enc = 'ёжик'.encode('utf-8') >>> struct.pack(f'={len(enc)}s', enc) b'\xd1\x91\xd0\xb6\xd0\xb8\xd0\xba' Заметьте, длина такой строки в байтах отличается от исходной длины, так как символы вне ASCII записываются двумя байтами и более. Поэтому здесь формат создаём на лету, используя получившуюся длину как каунтер токена. #libs#basic
Пребарај: #funfact
@googlefactss · Post #40935 · 15.04.2026 г., 16:32
Emoji” is derived from three Japanese words: “e” for picture, “mo” for write, “ji” for character. @googlefactss#funfact
Hashtags
@googlefactss · Post #39971 · 29.10.2025 г., 06:07
More than 2,000 years ago Persians used yakhchals — ancient desert "refrigerators" — to make sorbet-like desserts and store ice. [read more here] @googlefactss#funfact
Hashtags
@googlefactss · Post #39955 · 27.10.2025 г., 07:15
The word “canvas” is related to the word “cannabis.” Historically, canvases were made of hemp. @googlefactss#funfact
Hashtags
@googlefactss · Post #39950 · 26.10.2025 г., 05:39
Getting dumped often leads to “frustration attraction,” which causes an individual to love the one who dumped him or her even more. @googlefactss#funfact
Hashtags
@googlefactss · Post #39947 · 25.10.2025 г., 11:09
Human mucophagy (literally "mucus feeding") is the act of eating one's own "boogers." @googlefactss#funfact
Hashtags
@googlefactss · Post #39937 · 20.10.2025 г., 17:17
Cats don’t have sweat glands over their bodies like humans do. Instead, they sweat only through their paws. @googlefactss#funfact
Hashtags
@googlefactss · Post #39936 · 19.10.2025 г., 15:24
The word "work" is from the Proto-Indo-European word *werg, meaning "to do." @googlefactss#funfact
Hashtags
@googlefactss · Post #39935 · 18.10.2025 г., 11:41
The Greek name for the mosquito is "anopheles," which means “good for nothing @googlefactss#funfact
Hashtags
@googlefactss · Post #39934 · 18.10.2025 г., 10:14
The chess term “checkmate” is from a 14th-century Persian phrase, “shah mat," meaning “the king is helpless. @googlefactss#funfact
Hashtags
@googlefactss · Post #39932 · 17.10.2025 г., 19:29
Each leopard's spot pattern is unique, like a human fingerprint, allowing individual leopards to be identified. @googlefactss#funfact
Hashtags
@googlefactss · Post #39931 · 16.10.2025 г., 07:46
A pangram is a sentence that contains every letter in the language. For example, "The quick brown fox jumps over the lazy dog." @googlefactss#funfact
Hashtags
@googlefactss · Post #39930 · 16.10.2025 г., 07:11
If you wrote out all the numbers (e.g. one, two, three . . . ), you would not use the letter "b" until the word "billion." @googlefactss#funfact
Hashtags