This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
from copy import deepcopy | |
board = [['-','-','-'],['-','-','-'],['-','-','-']] | |
def prnt(): | |
print('-'*15) | |
for i in range(3): | |
print ("|| {} | {} | {} ||".format(*board[i])) | |
print('-'*15) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Добавить сравнение по википедии | |
# Добавить нечеткий поиск и если процент совпадения больше 90* то причислять к плагиату | |
import re | |
def get_text(file_name): | |
if(len(file_name)<15 and file_name.endswith('.txt')): | |
return open(file_name,'r', encoding = 'utf-8').read() | |
return file_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import asyncio | |
from bs4 import BeautifulSoup | |
proxy_list = [] | |
def get_html(URL): | |
r = requests.get(URL) | |
# print(r.request.headers) | |
if(r.status_code == 200): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
from multiprocessing import Pool | |
proxy_list = [] | |
def get_html(URL): | |
r = requests.get(URL) | |
# print(r.request.headers) | |
if(r.status_code == 200): | |
return r.text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import random | |
try: | |
from tkinter import * | |
except ImportError: | |
from Tkinter import * | |
class Block(object): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
def create_board(n = 3): | |
return [[ ((i*n + i//n + j) % (n*n) + 1) for j in range(n*n)] for i in range(n*n)] | |
def print_board(): | |
spacer = "++---+---+---++---+---+---++---+---+---++" | |
print(spacer) | |
for i in range(9): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def permutations(s): | |
if len(s) <= 1: | |
return [s] | |
else: | |
perms = [] | |
for e in permutations(s[:-1]): | |
for i in range(len(e)+1): | |
perms.append(e[:i] + s[-1] + e[i:]) | |
return perms | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf8 | |
import random | |
#def sumNumb(str):return sum(map(lambda x: int(x),str)) print(sumNumb("12")) | |
def sumNum(number): | |
return number//10+number%10 | |
def luna(cardNumber): | |
evenNumbers = cardNumber[::2] | |
oddNumbers = list(cardNumber[1::2]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import winsound | |
import time | |
''' | |
Тире равняется трем звучащим точкам; | |
Пауза между элементами одного символа (знака) — одна незвучащая точка; | |
Между знаками — три точки; | |
Между словами — семь точек. | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import random | |
from bs4 import BeautifulSoup | |
def get_html(url): | |
r = requests.get(url) | |
return r.text | |
NewerOlder