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
_ = input() | |
words = input().split() | |
max_length = 0 | |
longest_word = "" | |
for word in words: | |
if len(word) > max_length: | |
max_length = len(word) | |
longest_word = word |
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
temperature_of_days = [[-1, -10, -8, 0, 2, 0, 5], [3, 2, 5, 4, 8], [1, 2, 5, 4, 8]] | |
def check_chaotic_temperature(temperature_of_days): | |
chaotic_days = 0 | |
n = len(temperature_of_days) | |
if n == 1: | |
return 1 |
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 drf_yasg.utils import swagger_auto_schema | |
from rest_framework.decorators import api_view | |
from rest_framework import generics | |
from rest_framework.response import Response | |
from accounts.constants import UserStatus | |
from payments.serializers import UserCardAddSerializer, UserCardSerializer | |
from payments.utils import checkout_payment_token | |
from payments.models import UserCard |
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 drf_yasg.utils import swagger_auto_schema | |
from rest_framework.decorators import api_view | |
from rest_framework import generics | |
from rest_framework.response import Response | |
from accounts.constants import UserStatus | |
from payments.serializers import UserCardAddSerializer, UserCardSerializer | |
from payments.utils import checkout_payment_token | |
from payments.models import UserCard |
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 os | |
from django.contrib.auth import get_user_model | |
from core.celery import app | |
from django.core.mail import EmailMessage | |
from django.template.loader import render_to_string | |
from django.utils.encoding import force_bytes | |
from django.utils.http import urlsafe_base64_encode | |
from django.contrib.auth.tokens import default_token_generator |
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 django.contrib.auth import get_user_model | |
from django.utils.http import urlsafe_base64_decode | |
from rest_framework import generics, permissions | |
from rest_framework.decorators import api_view, permission_classes | |
from rest_framework.exceptions import PermissionDenied | |
from rest_framework import status | |
from rest_framework.generics import UpdateAPIView | |
from rest_framework.parsers import MultiPartParser, JSONParser | |
from rest_framework.permissions import AllowAny, IsAuthenticated | |
from rest_framework.response import Response |
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 | |
URL = 'https://www.python.org/' | |
HEADERS = { | |
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,' \ | |
'image/avif,image/webp,image/apng,*/*;q=0.8,application/' \ | |
'signed-exchange;v=b3;q=0.9', \ | |
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 ' \ | |
'(KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36' |
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 unittest | |
# The function returns the number module. | |
# You need to make a comparison. | |
# Also add check for types. | |
def is_even(number): | |
''' Returns True if **number** is even or False if it is odd. ''' | |
return number % 2 == 0 |
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 django.db import models | |
from django.http import HttpResponse | |
class Product(models.Model): | |
categories = models.ManyToManyField(Category, | |
related_name='products', | |
blank=True, verbose_name=u"категории") | |
related_products = models.ManyToManyField('Product', | |
blank=True, |