This file contains 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 time | |
def ping(): | |
time.sleep(1) | |
print('ping') | |
def pong(): | |
print('pong') | |
This file contains 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 threading | |
import time | |
def ping(): | |
time.sleep(1) | |
print('ping') | |
def pong(): | |
print('pong') |
This file contains 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
#my view | |
from django.contrib.auth.models import User | |
from django.contrib.auth.forms import UserCreationForm | |
from shop.signals import * #мой сигнал | |
class CodeCompare(View): | |
def post(self, request): | |
body_unicode = request.body.decode('utf-8') | |
body_unicode = json.loads(body_unicode) |
This file contains 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 datetime import datetime | |
# декораторы | |
def timeit(arg): | |
print(arg) | |
def outer(func): | |
def wrapper(*args, **kwargs): | |
start = datetime.now() |
This file contains 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
<?php | |
echo "-------------------------------задание 1--------------------------\n"; | |
$authors = | |
[ | |
["name" => "ivan ivanov", | |
"email" => "ivan@mail.hell", | |
"birthday" => "1888", | |
"books" => [ |
This file contains 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
<?php | |
/*-------------------------------задание 1--------------------------*/ | |
$books = [ | |
["name" => 'mertvec', | |
"publishing" => 1901, | |
"author" => [ | |
"name" => "ivan ivanov", | |
"email" => "ivan@mail.hell", |
This file contains 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
<?php | |
/*-------------------------------задание 1--------------------------*/ | |
$books = [ | |
["name" => 'mertvec', | |
"publishing" => 1901, | |
"author" => [ | |
"name" => "ivan ivanov", | |
"email" => "ivan@mail.hell", |
This file contains 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
<?php | |
/*-------------------------------задание 1--------------------------*/ | |
$books = [ | |
["name" => 'mertvec', | |
"publishing" => 1901, | |
"author" => [ | |
"name" => "ivan ivanov", | |
"email" => "ivan@mail.hell", |
This file contains 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
'use strict' | |
//1 | |
function guarantee(yearsGuarantee) { | |
yearsGuarantee = yearsGuarantee === undefined ? 0 : yearsGuarantee; | |
if (yearsGuarantee === 1) { | |
return console.log(`гарантийное обслуживание на ${yearsGuarantee} год будет стоить 1250 Q`); | |
} |
NewerOlder