Pythonist.ru - образование по питону
25.7K subscribers
211 photos
5 videos
5 files
1.06K links
Pythonist.ru - помощь в подготовке к собеседованию на позицию Python Developer.
Реклама: @anothertechrock

РКН: https://kurl.ru/WPjOT
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
👎5👌5
Задачка для начинающих

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

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

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

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

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

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
👎8👍3
Задачка для начинающих

Напишите программу для нахождения 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
👍4
Задачка для начинающих. Ответ

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
👍41🤯1
Задачка для начинающих

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

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

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

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

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

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

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

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

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

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

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

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


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

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


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


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

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