content
stringlengths
7
1.05M
_NOVAL = object() class Peekable(object): def __init__(self, iterator): self.iterator = iter(iterator) self._cached = None def has_next(self): try: self.peek() return True except StopIteration: return False def peek(self, default=_NOVAL)...
#! /usr/bin/env python3 # -*- coding:utf-8 -*- def is_cn_char(ch): """ Test if a char is a Chinese character. """ return ch >= u'\u4e00' and ch <= u'\u9fa5' def is_cn_sentence(sentence): """ Test if a sentence is made of Chinese characters. """ for ch in sentence: if not is_cn_char(ch): ...
# coding=utf-8 class Grant: """ A grant is described by : - The database on which it exists - The privilege granted - The table on which the grant applies - The owner of the table on which the grant applies (OPTIONNAL) - The user on wich the grant applies - The ...
"""Exceptions for BaseCollection.""" class CollectionIsEmptyExeption(Exception): """Exception class if the collection is empty.""" pass # noqa: WPS420, WPS604
# var inteiro a = 2 # var real b = 1.2 # var logico c = True # var caractere d = 'caractere' print('var a =>', type(a)) print('var b =>', type(b)) print('var c =>', type(c)) print('var d =>', type(d))
programmer_num = int(input("Enter a number for the user to guess: ")) num = int(input("Enter a number: ")) while num != programmer_num: if num > programmer_num: num = int(input("Incorrect please try again (hint: your number was too high): ")) elif num < programmer_num: num = int(input(...
load("@bazel_bootlin//toolchains:toolchain_info.bzl", "AVAILABLE_TOOLCHAINS") def all_platforms(): for architecture in AVAILABLE_TOOLCHAINS: for buildroot_version in AVAILABLE_TOOLCHAINS[architecture]: if buildroot_version not in native.existing_rules(): native.constraint_value(...
# # @lc app=leetcode.cn id=1627 lang=python3 # # [1627] last-moment-before-all-ants-fall-out-of-a-plank # None # @lc code=end
class SimpleIntegral: """ Get the first 5 integrals of the simple function: f(x) = x """ def __init__(self, x): self.x = x def get_first_integral(self): return (1 / 2) * self.x ** 2 def get_second_integral(self): return (1 / 6) * self.x ** 3 def get_third_...
''' Do contrário das Tuplas que são imutáveis, as Listas são mutáveis. E, em vez de parenteses () que identificam as Tuplas, as Listas levam parenteses rectos []. ''' # Exemplo de substituição de valores na Lista. num = [2, 5, 9, 1] print(num) num[2] = 3 print(num) # Exemplo de adição de valores na Lista. num.append(7...
while True: try: n = int(input()) if((n >= 1) and (n <= 1000)): for item in range(n): num = int(input ()) if((num >= 1) and (num <= 10**100)): led = 0 num = str(num) for y in num: ...
with open('./21/input_a.txt') as f: p1 = int(f.readline().strip()[-1:]) p2 = int(f.readline().strip()[-1:]) ddice = 1 def rollddice(num): global ddice ddice += num return (ddice-1) * num - num p1score, p1loc, p2score, p2loc = 0, p1, 0, p2 while max(p1score, p2score) < 1000: p1loc = (((p1loc ...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. INCLUDES = """ #include <openssl/asn1.h> #include <openssl/stack.h> """ TYPES = """ typedef int... time_t; typedef ... ASN1_INTEGER; st...
#!/usr/bin/env python """ oeis_py Author: Enrique Pérez Herrero Date: 13-Jun-2021 """
''' The web is built with HTML strings like "<i>Yay</i>" which draws Yay as italic text. In this example, the "i" tag makes <i> and </i> which surround the word "Yay". Given tag and word strings, create the HTML string with tags around the word, e.g. "<i>Yay</i>". ''' def make_tags(tag, word): return "<%s>%s</%s>"...
print ('テキストファイルを読み込む') f = open('./sample/sample1.txt', 'r', encoding='UTF-8') data = f.read() print(data) f.close()
number = int(input('Введите натуральное число: ')) while number > 0: if number % 10 == 5: print('Yes') break number = number // 10 else: print('No')
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. py:currentmodule:: leepstools.file.input .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> Read and write LEEPS input file .in """ ############################################################################### # Copyright 2017 Hendrix Demers # # L...
set_name(0x8014B0D8, "EA_cd_seek", SN_NOWARN) set_name(0x8014B0E0, "MY_CdGetSector", SN_NOWARN) set_name(0x8014B114, "init_cdstream", SN_NOWARN) set_name(0x8014B124, "flush_cdstream", SN_NOWARN) set_name(0x8014B148, "check_complete_frame", SN_NOWARN) set_name(0x8014B1C8, "reset_cdstream", SN_NOWARN) set_name(0x8014B1F0...
#dizer dentre 3 numeros qual é o maior print('^^' * 28) print("digite 3 numeros para saber qual deles é maior e menor") print('^^' * 28) n1 = float(input('numero 1: ')) n2 = float(input('numero 2: ')) n3 = float(input('numero 3: ')) #para saber o maior numero if n1 > n2 and n1 > n3: a = n1 if n2 > n1 and n2 > n3: ...
class Solution(object): def removeInterval(self, intervals, toBeRemoved): """ :type intervals: List[List[int]] :type toBeRemoved: List[int] :rtype: List[List[int]] """ removeStart, removeEnd = toBeRemoved output = [] for start, end in intervals: ...
def max(data): maxVal = 0 for i in data: if maxVal < i: maxVal = i return maxVal def min(data): minVal = -1 for i in data: if minVal == -1 or minVal > i: minVal = i return minVal def mean(data): sum = 0 for i in data: sum += i return ...
""" A thin logger. Will be replaced by logging module """ class Logger(object): def __init__(self, name): self.name = name def info(self, msg): print('I - {name} - {msg}'.format( name=self.name, msg=msg)) def warning(self, msg): print('W - {name} - {msg}'....
VERSION_MAJOR = 0 VERSION_MINOR = 1 VERSION_BUILD = 0 VERSION_INFO = (VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD) VERSION_STRING = "%d.%d.%d" % VERSION_INFO AUTHOR_NAME = "Eric Plaster" DESCRIPTION = "Adds Flywheel support to Flask-AppBuilder" AUTHOR_EMAIL = "plaster@gmail.com" __version__ = VERSION_INFO
ASIO_BASE = 'http://purl.org/hercules/asio/core#' RDFS_BASE = 'http://www.w3.org/2000/01/rdf-schema#' RDFS_LABEL = f'{RDFS_BASE}label' RDFS_COMMENT = f'{RDFS_BASE}comment' RDFS_SUBCLASSOF = f'{RDFS_BASE}subClassOf' RDF_BASE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' RDF_TYPE = f'{RDF_BASE}type' OWL_BASE = 'http...
a = 200 b = 33 if a > b: print("a is greater than b")
class Solution: def fizzBuzz(self, n: int) -> 'List[str]': result = [] for i in range(1, n + 1): if i % 15 == 0: ele = "FizzBuzz" elif i % 3 == 0: ele = "Fizz" elif i % 5 == 0: ele = "Buzz" else: ...
# DAY 5 - ACTIVITY 1 # Program Description: This is a program that uses a function ( studentAverage ) to process the student's grade. # This is the function that will take in the user's inputted information. # Then it will calculate the student's average. # lastly, it will add the information into the studentGrad...
#Desenvolva um programa que leia quatro valores pelo teclado #e guarde-os em uma tupla. No final mostre: #A)-Quantas vezes apareceu o valor 9 #B)-Em que posição foi digitado o primeiro valor 3 #C)-Quais foram os números pares num = (int(input('Digite um número: ')), int(input('Digite um número: ')), int(...
"""Constants for eskom loadshedding interface""" # Base component constants NAME = "Eskom Loadshedding Interface" DOMAIN = "eskom_loadshedding" DOMAIN_DATA = f"{DOMAIN}_data" VERSION = "1.0.5" ISSUE_URL = "https://github.com/swartjean/ha-eskom-loadshedding/issues" # Icons ICON = "mdi:lightning-bolt" # Platforms SENS...
""" link: https://leetcode-cn.com/problems/wiggle-sort problem: 将数组整理为 nums[0] <= nums[1] >= nums[2] <= nums[3]... 的形式 solution: 扫一遍。a[i-1] <= a[i] 时,若 a[i] < a[i+1], swap(a[i], a[i+1]),因为此时 a[i-1] <= a[i] < a[i+1],调整完有 a[i-1] < a[i+1] > a[i],满足条件且不对之前扫过的产生影响。同理处理 a[i-1] >= a[i] 的情况。 """ class Solution: ...
# Copyright (c) 2013-2017 CodeReclaimers, LLC class TraderBase(object): def __init__(self, pairs): self.pairs = pairs def onNewDepth(self, t, pair, asks, bids): pass def onNewTradeHistory(self, t, pair, trades): pass def onLoopEnd(self, t): pass d...
class Solution: def containsNearbyDuplicate(self, nums: List[int], k: int) -> bool: dictionary = {} for num_index in range(len(nums)): num = nums[num_index] if num in dictionary and num_index - dictionary[num] <= k: return True # else: ...
print( '-=' *30) print('Analisador de triângulos') print( '-=' *30) a = float(input('Digite o primeiro segmento:')) b = float(input('Digite o segundo segmento:')) c = float(input('Digite o terceiro segmento')) if a < b + c and b < c+ a and c < a +b: print('Podem se formar um trinagulo!') else: print('Não podem ...
#!/usr/bin/env python with open("Register.cmp") as fh: for num, l in enumerate(fh.readlines()): if num == 0: continue parts = [p.strip() for p in l.split('|')][2:] parts = [p for p in parts if len(p)] outparts = [] # last element is always empty cols = ['in', 'load', 'out'] for id...
class Rectangle: def __init__(self, width, height): print("I'm initializing a new Rectangle instance.") self.width = width self.height = height def __del__(self): print('A Rectangle instance is being destroyed.') def calculate_area(self): return self.width * self.he...
class GeoWeatherServiceFailedToLocateException(Exception): pass class GeoWeatherServiceFailedToRetrieveException(Exception): pass
class FilesDontMatchException(Exception): def __init__(self): pass def __str__(self): print ("The program has stopped because the files do not match the requirements.") return "The files do not match the requirements" class FastaRaroException(Exception): def __init__(self): pass ...
# -*- coding: utf-8 -*- """ Created on Fri Dec 27 12:19:49 2019 @author: thisisbex """
# -*- coding: utf-8 -*- """ Created on Mon Dec 25 21:00:24 2017 @author: James Jiang """ all_lines = [line.rstrip('\n') for line in open('Data.txt')] def has_bab(string, b, a): chars = [i for i in string] for i in range(1, len(chars) - 1): if chars[i] == a: if (chars[i - 1] == b) and (cha...
qLst=[] def isEmpty(qLst): if len(qLst) == 0: return 1 else: return 0 # Function to add elements in Queue def Enqueue(qLst, val): qLst.append(val) if len(qLst) == 1: front = rear = 0 else: rear = len(qLst) - 1 # Function to Delete elements in Que...
N = int(input()) N2 = input() answer = 0 for i in N2: answer += int(i) print(answer)
def intervalIntersection(self, firstList: List[List[int]], secondList: List[List[int]]) -> List[List[int]]: ''' basically change the min of the right hand side of the intervals ''' # edge case if firstList == [] or secondList == []: return [] ...
# DROP TABLES songplay_table_drop = "DROP TABLE IF EXISTS songplays" user_table_drop = "DROP TABLE IF EXISTS users" song_table_drop = "DROP TABLE IF EXISTS songs" artist_table_drop = "DROP TABLE IF EXISTS artists" time_table_drop = "DROP TABLE IF EXISTS time" # CREATE TABLES songplay_table_create = (""" CREATE TABLE...
power = {'BUSES': {'Area': 1.33155, 'Bus/Area': 1.33155, 'Bus/Gate Leakage': 0.00662954, 'Bus/Peak Dynamic': 0.0, 'Bus/Runtime Dynamic': 0.0, 'Bus/Subthreshold Leakage': 0.0691322, 'Bus/Subthreshold Leakage with power gating': 0.0259246, 'Gate...
# coding: utf-8 class ContextManager(object): def __init__(self, statement, task, **kwargs): self.statement = statement self.task = task def process_task(self): raise NotImplementedError()
def quick_sort(arr, left, right): if left < right: # Partition the array by setting the position of the pivot value position = Partition(arr, left, right) # Sort the left quick_sort(arr, left, position - 1) # Sort the right quick_sort(arr, position + 1, right) re...
people = [ { 'name': "Мария", 'interests': ['пътуване', 'танци', 'плуване', 'кино'], 'age': 24, 'gender': "female", "ex": ["Кирил", "Петър"], }, { 'name': "Диана", 'interests': ['мода', 'спортна стрелба', 'четене', 'скандинавска поезия'], 'age'...
def verify_response(expected_response, response): if isinstance(expected_response, dict): assert isinstance(response, dict) iterator = expected_response.items() elif isinstance(expected_response, list): assert isinstance(response, list) assert len(expected_response) == len(respon...
#HUGHXIE #factorial.py cache = dict() def factorial(x): if x < 2: return x else: x *= factorial(x-1) return x def cachedfactorial(x): global cache if x < 2: cache[x] = 1 if x > len(cache): cache[x] = x*cachedfactorial(x-1) return(cache.get(x))
x_coord = [23, 53, 2, -12, 95, 103, 14, -5] y_coord = [677, 233, 405, 433, 905, 376, 432, 445] z_coord = [4, 16, -6, -42, 3, -6, 23, -1] labels = ["F", "J", "A", "Q", "Y", "B", "W", "X"] points = [] # write your for loop here for l, x, y, z in zip(labels,x_coord,y_coord,z_coord): point = l + ': ' + ', '.join([str(...
# coding=utf-8 # # @lc app=leetcode id=944 lang=python # # [944] Delete Columns to Make Sorted # # https://leetcode.com/problems/delete-columns-to-make-sorted/description/ # # algorithms # Easy (69.40%) # Likes: 60 # Dislikes: 1008 # Total Accepted: 26.1K # Total Submissions: 37.6K # Testcase Example: '["cba","d...
class Cluster(object): """ Cluster contains groups of values by their specified key """ def __init__(self, cluster): self.__cluster = cluster def __contains__(self, item): return self.__cluster.containsValue(item) def size(self): return self.__cluster.size() def ge...
ABORTED = 'Aborted' FAILED = 'Failed' NOT_PROCESSED = 'Not Processed' COMPLETED = 'Completed' ERROR_STATES = ( ABORTED, FAILED, NOT_PROCESSED, )
def generator_example(): yield 1 def non_builtin_example(a): return a def mock_example(a): return a def list_example(a): return a def multi_line_docstring_example(): """ La \ndi dee One Two Three """ return 'Eric the half a bee' def two_line_docstring(): """a b ...
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def removeNthFromEnd(self, head: ListNode, n: int) -> ListNode: tail = head length = 1 while tail.next: length += 1 ...
''' # Sample code to perform I/O: name = input() # Reading input from STDIN print('Hi, %s.' % name) # Writing output to STDOUT # Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail ''' # Write your code here t = int(input()) g = {} m = {} for i in ran...
totmaior = tothomem = tot20f = 0 while True: print('-'*24) print('{:^24}'.format('CADASTRE UMA PESSOA')) print('-'*24) sexo = parar = '.' idade = int(input('Idade: ')) # try: # idade = int(idade) # TODO o que é tudo isso? (try) # except ValueError: # prin...
class ShaderNodeOutput: is_active_output = None
lista = [[], []] for i in range(0, 7): numero = (int(input(f'Digite o {i + 1}º valor: '))) if numero % 2 == 0: lista[0].append(numero) else: lista[1].append(numero) print(f'Os numeros pares são: {sorted(lista[0])}') print(f'Os numeros impares são: {sorted(lista[1])}')
# import board # import busio as io # import adafruit_mlx90614 # import RPi.GPIO as GPIO # from time import sleep # import asyncio # GPIO.setmode(GPIO.BCM) class temp: def __init__(self): # GPIO.setmode(GPIO.BCM) pass async def readTemp(self): ...
class ComplexNumber: def __init__(self, real, imaginary): pass def __eq__(self, other): pass def __add__(self, other): pass def __mul__(self, other): pass def __sub__(self, other): pass def __truediv__(self, other): pass def __abs__(self)...
a = int(input("")) b = int(input("")) x = (a*b) print("PROD = " + str(x))
def even_and_odd_sum(num): even = 0 odd = 0 for element in range(0, len(num)): if int(num[element]) % 2 == 0: even += int(num[element]) else: odd += int(num[element]) return f"Odd sum = {odd}, Even sum = {even}" print(even_and_odd_sum(input()))
def _simple_callback_arg_unpack(network, arg, request_id): network._call(request_id, *arg) def _simple_callback_arg(network, arg, request_id): network._call(request_id, arg) def _simple_callback_no_arg(network, arg, request_id): network._call(request_id)
def find_sra_col(metadata, col=None, PREFIX='SRR'): def column_iter(md, col): column = md.get_column(col) if metadata.columns[col].type != "categorical": raise ValueError("`col` is not a categorical column.") yield column.drop_missing_values().to_series() def metadata_iter...
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. { 'includes': [ '../sdk/runtime/tools/gyp/runtime-configurations.gypi', ], 'targets': [ { ...
class Config(object): DEBUG = False TESTING = False APP_NAME = "I choose you" SLASH_COMMAND = "/ichu" DATABASE_URI = "mongodb://localhost:27017/ichooseyoudb" API_URL = "https://ichooseyou.etienne-t.fr" WAIT_FOR_THREAD_BEFORE_RETURN = False class ProductionConfig(Config): DEBUG = False ...
name = input("Put your name : ").capitalize() lastName = input("Put your last name : ").capitalize() print("Hello !! %s %s !" % (name,lastName)) text = "Zeno" textFormatted = "Welcome %s"%(name) print(textFormatted.center(21,"-")) print(len(name))
# -*- coding: utf-8 -*- # the version of software # this is used by the setup.py script __version__ = '0.0.1.dev1'
"""***************************************************************************** * Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * responsibility to ...
#Buatlah sebuah fungsi yang memiliki sebuah parameter yang bertipe list dan berisi #daftar nama orang (hanya terdiri dari satu kata). Lalu kembalikan sebuah string yang #merupakan nama terpanjang. def mulai(): nama1 = str(input()) nama2 = str(input()) nama3 = str(input()) if len(nama1) >= len(n...
## TheJollyDuck ## FizzBuzz ## This program prints out numbers but for ## a specifc multiple of a number with a word numList = [3,5,10,13] wordlist = ["fizz","buzz","fizzle","kaboom"] print("FizzBuzz is starting....") # TO DO : Implement input safety so that it only accepts ints numberLimit = int(input("Up to what n...
# fibonnaci function def fib(n): ''' prints out a list of n fibonnaci numbers Args: parm1: n is the number of fibonnaci numbers to print Returns: nothing ''' print("Called from ",__name__) a, b = 0, 1 #Note multiple assignment! counter = 1 while counter < n: print (a, end=' ') a, b = b...
load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies") load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") load("@rules_jvm_external//:defs.bzl", "maven_install") load("@...
# Дуэль + Выигрышные номера последних 4 тиражей def test_duel_winning_numbers_last_4_draws(app): app.ResultAndPrizes.open_page_results_and_prizes() app.ResultAndPrizes.click_game_duel() app.ResultAndPrizes.click_winning_numbers_of_the_last_4_draws() app.ResultAndPrizes.button_get_report_winners() ...
def test_spamd_service(Service): assert Service('spamd').is_running def test_spamd_config(File): assert File('/etc/rc.conf.local').contains('spamd_flags=') def test_bgpd_config(File, Sudo): with Sudo(): assert File('/etc/bgpd.conf').contains('spamdAS') def test_pf_anchor(File, Command, Sudo): ...
nums = [4, 2, 2, 3, 3, 1] nums.sort() # 存放nums中不重复的元素 temp = set() res = [] # 存放出现两次的元素 for x in nums: if x not in temp: temp.add(x) else: # 如果不存在res中,则x只出现了一次 # 如果之前已经添加过x到res中去了,就需要 if x not in res: res.append(x) res = [str(x) for x in res] print(' '.join(res))...
def extractExplore(item): """ Explore """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None chp_prefixes = [ ('geww ', 'Ghost Emperor Wil...
class Solution: def containsDuplicate(self, nums: List[int]) -> bool: s = set() for num in nums: if num in s: return True else: s.add(num) return False
# Listing_22-4.py # Copyright Warren & Csrter Sande, 2013 # Released under MIT license http://www.opensource.org/licenses/mit-license.php # Version $version ---------------------------- # Zapisujemy dane w nowym pliku nowy_plik = open("nowe_notatki.txt", 'w') nowy_plik.write("Zjeść kolację\n") nowy_plik.write("Zag...
""" Copyright 2020~ PeTrA. All rights reserved. . Python Project Structure Repository; """ # PythonProjectStructure/tests/package/__init__.py;
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def github_repository(*, name=None, remote=None, commit=None, tag=None, branch=None, build_file=None, build_file_content=None, ...
""" 多重继承 - 通过多重继承可以给一个类的对象具备多方面的能力 - 这样在设计类的时候可以避免设计太多层次的复杂的继承关系 Version: 0.1 Author: 骆昊 Date: 2018-03-12 """ class Father(object): def __init__(self, name): self._name = name def gamble(self): print('%s在打麻将.' % self._name) def eat(self): print('%s在大吃大喝.' % self._name) class ...
def parse_while(state, pred): """ pred: a boolean-valued function (i.e. a predicate) on a character postcondition: `state.pos` is at the first character *not* satisfying `pred`, after the original `state.pos` at call-time, or `len(self.text)` if there is no such character returns: the te...
# encoding: utf-8 # module IronPython # from IronPython.SQLite, Version=2.7.7.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1, IronPython.Wpf, Version=2.7.7.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1 # by generator 1.145 """ NamespaceTracker represent a CLS namespace. """ # no imports # no function...
def main(j, args, params, tags, tasklet): params.merge(args) params.result = "" tags = params["tags"] id = tags.tagGet("id") model = tags.tagGet("model") actor = tags.tagGet("actor") application = tags.tagGet("application") if application == "": application = "system" # ...
# -*- coding: utf-8 -*- # pylint: disable=unused-argument """Tests for the `CifCellContentsParser`.""" def test_cif_cell_contents_standard( fixture_database, fixture_computer_localhost, generate_calc_job_node, generate_parser ): """Test a default `cif_cell_contents` calculation.""" entry_point_calc_job = ...
# # PySNMP MIB module ALVARION-CONNECTION-LIMITING-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALVARION-CONNECTION-LIMITING-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:06:13 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Pyt...
class TokenizerNER(object): r''' Args: hf_tokenizer Must be able to return token offsets max_len: Max sequence length, if longer it will be split into multiple examples ''' def __init__(self, hf_tokenizer, max_len=512, id2type=None): self.hf_tokenizer = ...
# # @lc app=leetcode.cn id=1586 lang=python3 # # [1586] longest-subarray-of-1s-after-deleting-one-element # None # @lc code=end
# Source : https://leetcode.com/problems/maximum-product-difference-between-two-pairs/ # Author : foxfromworld # Date : 16/12/2021 # First attempt class Solution: def maxProductDifference(self, nums: List[int]) -> int: nums.sort() return nums[-1] * nums[-2] - nums[0] * nums[1]
listOfGroups = [] with open("C:\\Privat\\advent_of_code20\\puzzle6\\input1.txt") as f: group = [] for line in f: line = line.strip() if line == '': listOfGroups.append(group) group = [] continue for char in line: if not char in group: ...
class SpeciesError(Exception): def __init__(self, msg=None): self.msg = msg def __str__(self): return str(self.msg) class KineticsError(Exception): def __init__(self, msg=None): self.msg = msg class ConcentrationError(Exception): def __init__(self, msg=None): self....
years = range(1988, 2000) vars = ['ta_2m', 'pr', 'psl', 'rss', 'rls', 'wss_10m', 'hur_2m', 'albedo', 'ps', 'ts_0m'] hourres = ['1H', '1H', '1H', '3H', '3H', '1H', '1H', '1H', '3H', '1H'] b11b = 'NORA10' b11c = '11km' paths = ['%s_%s_%s_%s_%s.nc' % (b11b, hourres[vi], b11c, vars[vi], y) for vi in ran...
# Модуль 1 def f(a, b): summ = a + b return summ print(f(10, 20))
test = { 'name': 'Car', 'points': 0, 'suites': [ { 'cases': [ { 'code': r""" >>> from car import * >>> deneros_car = Car('Tesla', 'Model S') >>> deneros_car.model d44fbfeedd5748e8ed04de29de968251 # locked >>> deneros_car.gas =...
#https://www.acmicpc.net/problem/2798 n, m = map(int, input().split()) a = list(map(int, input().split())) min_result = m answer = 0 for i in range(n): for j in range(i+1, n): for k in range(j+1, n): sum_a = a[i]+a[j]+a[k] if sum_a <= m and m-sum_a < min_result: mi...
class DefaultHandler: """ 持有handler的实例 """ plain = None guild = None guild_member = None channel = None message = None at_message = None direct_message = None audio = None message_reaction = None
# # voice-skill-sdk # # (C) 2020, Deutsche Telekom AG # # Deutsche Telekom AG and all other contributors / # copyright owners license this file to you under the MIT # License (the "License"); you may not use this file # except in compliance with the License. # You may obtain a copy of the License at # # https://opensou...