Skip to content

Instantly share code, notes, and snippets.

View begimai's full-sized avatar

Begimai Amantaeva begimai

  • Bishkek, Kyrgyzstan
View GitHub Profile
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/code.py", line 90, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/jwt/api_jwt.py", line 64, in encode
return super(PyJWT, self).encode(
File "/usr/local/lib/python3.8/site-packages/jwt/api_jws.py", line 113, in encode
key = alg_obj.prepare_key(key)
import datetime
from typing import Dict, List
from apps.orders.models import OrderQuerySet
def split_by_order_dates(available_dates: List[Dict[str, datetime.datetime]],
ordered_dates: 'OrderQuerySet') -> List[Dict[str, datetime.datetime]]:
"""
@begimai
begimai / word_order.py
Created September 29, 2019 15:56
You are given words. Some words may repeat. For each word, output its number of occurrences. The output order should correspond with the input order of appearance of the word. See the sample input/output for clarification.
my_dict = {}
num = int(input())
for x in range(num):
word = input()
if word in my_dict:
my_dict[word] += 1
else:
my_dict[word] = 1