TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Hashtags

Резултати

Пронајдени 5 слични објави

Пребарај: #datastructures

当前筛选 #datastructures清除筛选
Repositorio data science

@repo_science · Post #3438 · 14.07.2023 г., 19:11

#python#DataStructures#algorithms 🐍 Python Data Structures & Algorithms What you will get in this course: - Data Structures Lists Linked Lists Doubly Linked Lists Stacks & Queues Binary Trees Hash Tables Graphs - Algorithms - Sorting Bubble Sort Selection Sort Insertion Sort Merge Sort Quick Sort - Searching Breadth First Search Depth First Search 🔗Link ----- Main channel:@repo_science Coupons:@freecoupons_reposcience -----

Repositorio data science

@repo_science · Post #3348 · 25.06.2023 г., 17:31

#python#Algorithms#dataStructures 🐍 Hands-On Data Structures and Algorithms with Python: Store, manipulate, and access data effectively and boost the performance of your applications 🖇3rd Edition 📆2022 ✍️Dr. Basant Agarwal 🔗Link ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----

Repositorio data science

@repo_science · Post #3433 · 12.07.2023 г., 19:56

#DataStructures#Algorithms#Java 🛠 The Ultimate Data Structures & Algorithms Course What You'll Learn... This course is divided into three parts, each about 5 hours long so you can easily complete it. The first part is all about linear data structures and their algorithms: - Big O Notation - Arrays - Linked Lists - Stacks - Queues - Hash Tables The second part covers non-linear data structures and their algorithms: - Binary Trees - AVL Trees - Heaps - Tries - Graphs The third part explores: - Searching Algorithms - Sorting Algorithms - String Manipulation Algorithms 🗣Mosh Hamedani 🔗Link ----- Main channel:@repo_science Coupons:@freecoupons_reposcience -----

Repositorio data science

@repo_science · Post #3109 · 28.04.2023 г., 17:58

#datascientist#datascience#datasciencejobs#dataanalysis#data#dataanalyst#dataanalytics#dataanalystjobs#analytics#python#pythonprogramming#rprogramming#sql#excel#statistics#testing#softwaretesting#projects#projectmanagement#agile#computerscience#programming#webdevelopment#softwaredevelopment#roadmap#visualization#learningeveryday#learning#tutorials#learntocode#apache#powerbi#tableau#machinelearning#ml#ai#artficialintelligence#deeplearning#bigdata#bigdataanalytics#algorithms#mathematics#datastructures#kaggle#nlp#reinforcementlearning#sql#nosql#databases#mongodb ----- Canal principal:@repo_science Cupones: @freecoupons_reposcience -----