Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 124 additions & 124 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,124 +1,124 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
106 changes: 53 additions & 53 deletions Lesson_1/task_1.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
'''
1. Каждое из слов «разработка», «сокет», «декоратор» представить в строковом формате и проверить тип и содержание соответствующих переменных. Затем с помощью онлайн-конвертера преобразовать строковые представление в формат Unicode и также проверить тип и содержимое переменных.
'''



def unicode_converter(input_str):
res = input_str.encode('unicode-escape')

return res.decode('utf-8')


russian_words_arr = ['разработка', 'сокет', 'декоратор']
russian_words_unicode_arr = [
'\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430',
'\u0441\u043e\u043a\u0435\u0442',
'\u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440'
]

for i in range(0, len(russian_words_arr)):
print('str:' , russian_words_arr[i])
print('Unicode str:' , russian_words_unicode_arr[i])
print('Uncode points:', unicode_converter(russian_words_arr[i]))
print('Type of str:', type(russian_words_arr[i]))
print('Type of unicode str:', type(russian_words_unicode_arr[i]))
print('\n')





'''
Output:

str: разработка
Unicode str: разработка
Uncode points: \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430
Type of str: <class 'str'>
Type of unicode str: <class 'str'>


str: сокет
Unicode str: сокет
Uncode points: \u0441\u043e\u043a\u0435\u0442
Type of str: <class 'str'>
Type of unicode str: <class 'str'>


str: декоратор
Unicode str: декоратор
Uncode points: \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440
Type of str: <class 'str'>
Type of unicode str: <class 'str'>
'''
1. Каждое из слов «разработка», «сокет», «декоратор» представить в строковом формате и проверить тип и содержание соответствующих переменных. Затем с помощью онлайн-конвертера преобразовать строковые представление в формат Unicode и также проверить тип и содержимое переменных.
'''
def unicode_converter(input_str):
res = input_str.encode('unicode-escape')
return res.decode('utf-8')
russian_words_arr = ['разработка', 'сокет', 'декоратор']
russian_words_unicode_arr = [
'\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430',
'\u0441\u043e\u043a\u0435\u0442',
'\u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440'
]
for i in range(0, len(russian_words_arr)):
print('str:' , russian_words_arr[i])
print('Unicode str:' , russian_words_unicode_arr[i])
print('Uncode points:', unicode_converter(russian_words_arr[i]))
print('Type of str:', type(russian_words_arr[i]))
print('Type of unicode str:', type(russian_words_unicode_arr[i]))
print('\n')
'''
Output:
str: разработка
Unicode str: разработка
Uncode points: \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430
Type of str: <class 'str'>
Type of unicode str: <class 'str'>
str: сокет
Unicode str: сокет
Uncode points: \u0441\u043e\u043a\u0435\u0442
Type of str: <class 'str'>
Type of unicode str: <class 'str'>
str: декоратор
Unicode str: декоратор
Uncode points: \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440
Type of str: <class 'str'>
Type of unicode str: <class 'str'>
'''
Loading