Pythonist.ru - образование по питону
26.1K subscribers
86 photos
1 video
960 links
Pythonist.ru - помощь в подготовке к собеседованию на позицию Python Developer.
Реклама: @anothertechrock

Контент канала:
1. Разбор вопросов с собеседований
2. Книги
3. Задачи на логику
4. Проект Эйлера
5. Видео
6. Тесты по Python 3

@aldrson
Download Telegram
Задачка для начинающих. Ответ

def test_range(n, x, y):
if n in range(x, y):
print(" %s входит в диапазон" % str(n))
else:
print("Это число не входит в диапазон.")


test_range(3, 3, 9)

#coding #beginner
Задачка для начинающих

Напишите программу для рисования следующего паттерна:

* 
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*

Используйте вложенный цикл for.

Пишите ответы в комментариях, а мы свой вариант опубликуем завтра.

#coding #beginner
Задачка для начинающих. Ответ

n = 5
for i in range(n):
for j in range(i):
print('* ', end="")
print('')

for i in range(n, 0, -1):
for j in range(i):
print('* ', end="")
print('')

#coding #beginner
Задачка для начинающих

Напишите программу для нахождения 10 наиболее часто встречающихся слов в тексте. Выведите сами слова и их количество.

Вывод:
[('Python', 6), ('the', 6), ('and', 5), ('We', 2), ('with', 2), ('The', 1), ('Software', 1), ('Foundation', 1), ('PSF', 1), ('is', 1)]

Текст:

The Python Software Foundation (PSF) is a 501(c)(3) non-profit corporation that holds the intellectual property rights behind the Python programming language. We manage the open source licensing for Python version 2.1 and later and own and protect the trademarks associated with Python. We also run the North American PyCon conference annually, support other Python conferences around the world, and fund Python related development with our grants program and by funding special projects.

Пишите ответы в комментариях, а мы свой вариант опубликуем завтра.

#coding #beginner
Задачка для начинающих. Ответ

from collections import Counter
import re

text = """The Python Software Foundation (PSF) is a 501(c)(3) non-profit corporation that holds the intellectual property rights behind the Python programming language. We manage the open source licensing for Python version 2.1 and later and own and protect the trademarks associated with Python. We also run the North American PyCon conference annually, support other Python conferences around the world, and fund Python related development with our grants program and by funding special projects."""

words = re.findall('\w+', text)
print(Counter(words).most_common(10))

#coding #beginner
Задачка для начинающих

Напишите код для вывода пересечения множеств.

Пишите ответы в комментариях, а мы свой вариант опубликуем завтра.

#coding #beginner
Задачка для начинающих. Ответ

setx = set(["зеленый", "синий"])
sety = set(["синий", "желтый"])

print("\nПересечение множеств:")
setz = setx & sety
print(setz)

#coding #beginner
Задачка для начинающих

Напишите код для преобразования кортежа строк в одну строку.

Пишите ответы в комментариях, а мы свой вариант опубликуем завтра.

#coding #beginner
Задачка для начинающих. Ответ

tup = ('e', 'x', 'e', 'r', 'c', 'i', 's', 'e', 's')
str = ''.join(tup)
print(str)

#coding #beginner
НАВИГАЦИЯ ПО ПОСТАМ

Статьи о разработке на Python - #топ
Советы по Python - #tipsandtricks
Машинное обучение - #ml
Django - #django


Отдельные темы:

Строки - #строки
Списки - #списки
Функции - #функции
Словари - #словари
Модули - #модули
Алгоритмы - #алгоритмы


Подборки и обзоры книг - #книги


Задачки и тесты:

Задачи с кодом - #coding
Задачки для начинающих - #beginner
Задачи на логику - #логическаязадача
Тесты - #тест