content
stringlengths
7
1.05M
# ["172.16.3.1", “172.16.1.5”, “172.15.2.0”, “172.16.3.1”, “172.16.3.1”, “172.16.1.5”]统计在此列表中每一个ip出现的次数,并输出出现频率最高的成员 l = ["172.16.3.1","172.16.1.5", "172.15.2.0", "172.16.3.1", "172.16.3.1","172.16.1.5"] s1 = l.count('172.16.3.1') s2 = l.count('172.16.1.5') s3 = l.count('172.15.2.0') b1 = l[0] b2 = l[1] b3 = l...
#定义个返回response类,方便使用 class BaseResp: def __init__(self,code,msg,data=None): self.code=code self.msg=msg self.data=data class respCode: SUCCESS=200 UNAUTHERROR=401 PARAMERR=402 def respSuccess(msg,data=None): return BaseResp(code=respCode.SUCCESS,msg=msg,data=data).__dict__ ...
# # @lc app=leetcode id=1137 lang=python3 # # [1137] N-th Tribonacci Number # # https://leetcode.com/problems/n-th-tribonacci-number/description/ # # algorithms # Easy (62.05%) # Likes: 1412 # Dislikes: 88 # Total Accepted: 204K # Total Submissions: 328.7K # Testcase Example: '4' # # The Tribonacci sequence Tn i...
test_cases = int(input().strip()) secrets = { '0001101': 0, '0011001': 1, '0010011': 2, '0111101': 3, '0100011': 4, '0110001': 5, '0101111': 6, '0111011': 7, '0110111': 8, '0001011': 9, } for t in range(1, test_cases + 1): N, M = map(int, input().strip().split()) code ...
homepage_publish_event = { "sys": { "type": "Entry", "id": "5bfZXM2wx8fCAb60IuLDdH", "space": { "sys": { "type": "Link", "linkType": "Space", "id": "83pwon8meh4m" } }, "environment": { "sys": ...
""" Entradas --> 11 valores float entre notas de tareas y examentes finales Examen Matematicas --> float --> ex_m Nota 1 matematicas --> float --> M1 Nota 2 matematicas --> float --> M2 Nota 3 matematicas --> float --> M3 Examen Física --> float --> ex_f Nota 1 física --> float --> f1 Nota 2 física --> float --> f2 ...
# arquivo principal # Declarando a variavel "sinal" sinal = input("Qual operação deseja realizar ?") # criando loop de repetição em caso de erro de digitação while(sinal != '+' and sinal != '-' and sinal != '*' and sinal != '/'): print("\n Você digitou uma operação invalida!") sinal = input('\nQual operação d...
# Py PI = 3.1415926535897932384626433832795 #endif # 2.0 * PI TWO_PI = 6.283185307179586476925286766559 #endif # PI / 2.0 HALF_PI = 1.5707963267948966192313216916398 # 2.0/3.0 * PI TWOTHIRD_PI = 2.0943951023931954923084289221863 # degree to pi multiplier (PI/360.0) DEG_TO_PI = PI/360.0 # degree to 2*pi multiplier...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Sep 30 17:38:52 2017 @author: zhejianpeng """ answer = 'ab' secret = ['a','a'] input_board = ['aabbbbbb','aabbbbbb','bbbbbbbb','bbbbbbbb','bbbbbbbb','bbbbbbbb','bbbbbbbb','bbbbbbbb'] board = [] for i in input_board: board.append(list(i)) # count = n...
def add(x, y): """Return sum of 2 numbers""" return x+y def subtract(x, y): '''Subtract x-y''' return x-y
#!/usr/bin/env python3 # Task3: Caesar cipher # U = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] l = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] def find_char(char, secret, lst): """Takes a ...
""" 3.1 Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75). You should use ...
class CommentInteraction: def __init__(self, like=None, dislike=None): self.like = like # Int self.dislike = dislike # Int @staticmethod def generate(source): if source is None or type(source) is str and len(source) == 0: return CommentInteraction() return Com...
# local settings for this tlsscout installation, # the {{ foo }} bits should be replaced with real values (by Ansible or by hand) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'hemmelig' # debug settings - remember to set allowed_hosts if debug is disabled DEBUG=True ALLOWED_HOSTS = ...
# # PySNMP MIB module Juniper-HOST-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-HOST-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:02:51 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar ...
##def do_twice(f): # f() # f() # #def print_spam(): # print('spam') # #do_twice(print_spam) def do_twice(dt_function,dt_value): dt_function(dt_value)*2 thing = "Sausage, Egg and Spam" do_twice(print,"thing")
#!/usr/bin/env python # encoding: utf-8 ''' @author: Jason Lee @license: (C) Copyright @ Jason Lee @contact: jiansenll@163.com @file: jianzhi_offer_28.py @time: 2019/3/26 18:26 @desc: 字符串的排列: 输入一个字符串,按字典序打印出该字符串中字符的所有排列。 例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。 Recursive implementation ''' ...
class Tile: map_word = "Island beach" def describe(self): print("The beach is really quiet and you can hear and see the seagulls " "on the sea.\n") def action(self, player, do): print("What is this gibberish?") def leave(self, player, direction): if direction...
f = maxsumit assert f([]) == [] assert f([-1]) == [] assert f([0]) == [] assert f([1]) == [1] assert f([1, 0]) == [1] assert f([0, 1]) == [0, 1] assert f([0, 1, 0]) == [0, 1] assert f([2]) == [2] assert f([2, -1]) == [2] assert f([-1, 2]) == [2] assert f([-1, 2, -1]) == [2] assert f([2, -1,...
field=[[0]*100 for i in range(100)] n,m=map(int,input().split()) for i in range(n): x,y,a,b=map(int,input().split()) for j in range(x-1,a): for k in range(y-1,b): field[j][k]+=1 a=0 for i in range(100): for j in range(100): if field[i][j]>m:a+=1 print(a)
class oprand: def init (self): self.props = {} def add (self, name, value): self.props[name] = value def get (self, name): return self.props.get(name, "") def remove (self, name): return self.props.pop(name) def parse (self, stream): pass def run (s...
print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') print(' Hello world ') print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') user_input = input('What is your name?') reply = 'Nice to meet you ' + user_input print(reply)
def get_next_sparse(num): str_bin = str(bin(num))[2:] new_str_bin = "" prev_digit = None flag = False for i, digit in enumerate(str_bin): if digit == '1' and prev_digit == '1': flag = True if flag: new_str_bin += '0' * (len(str_bin) - i) break ...
#!/usr/bin/env python # coding=utf-8 ''' @Author: John @Email: johnjim0816@gmail.com @Date: 2020-07-22 11:28:02 @LastEditor: John @LastEditTime: 2020-07-22 11:28:19 @Discription: @Environment: python 3.7.7 ''' # Source : https://leetcode.com/problems/search-in-rotated-sorted-array/ # Author : JohnJim0816 # Date : 20...
__author__ = 'mcxiaoke' def gen(): for i in range(4): yield i gene=gen() print(type(gene)) print(gene.next()) print(gene.next()) print(gene.next()) re=iter(range(10)) try: #for i in range(5): for i in range(20): print(re.next()) except StopIteration as e: print('here is the end: ',i)...
l = list(range(101)) def even(i): return i % 2 == 0 print(list(filter(even, l))) def fake_filter(function, list): list_new=[] for n in list: if function(n) is True: list_new.append(n) return list_new print(fake_filter(even, l))
# # PySNMP MIB module BCCUSTOM-OPR-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BCCUSTOM-OPR-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:36:29 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar ...
def findDecision(obj): #obj[0]: Driving_to, obj[1]: Passanger, obj[2]: Weather, obj[3]: Temperature, obj[4]: Time, obj[5]: Coupon, obj[6]: Coupon_validity, obj[7]: Gender, obj[8]: Age, obj[9]: Maritalstatus, obj[10]: Children, obj[11]: Education, obj[12]: Occupation, obj[13]: Income, obj[14]: Bar, obj[15]: Coffeehouse,...
class PyraFaceMapper: @staticmethod def is_face_twist(original_move: str) -> bool: return (len(original_move) >= 2 and original_move[1] == 'w') or \ (len(original_move) >= 3 and original_move[0] == '2' and original_move[2] == 'w') @staticmethod def convert_vertex_twist_...
class TestGenerate(unittest.TestCase): def test_generate_bin(self): M = [1, 1, 1, 3, 3, 3, 5, 5, 5, 5, 2, 6] ctrl = [0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 0, 3] self.assertTrue(np.array_equal(ctrl, generate_bin(M, 3))) M = np.array([0.1, 3.0, 0.0, 1.2, 2.5, 1.7, 2]) ctrl = [0, 3, 0...
def test_admin_peers(web3, skip_if_testrpc): skip_if_testrpc(web3) assert web3.admin.peers == []
''' LeetCode Q.1170 Compare Strings by Frequency of the Smallest Character ''' def numSmallerByFrequency(queries, words): def bin_search(arr, t): l = 0 r = len(arr)-1 while l <= r: mid = (l+r)//2 if l == r: if arr[mid] > t: retu...
#!/usr/bin/env python prod = 0 for a in range(1, 1001): for b in range(a + 1, 1001): c = 1000 - a - b if a**2 + b**2 == c**2: prod = a * b * c break if prod != 0: break print(prod)
def max_sub_array(nums): """ Returns the max subarray of the given list of numbers. Returns 0 if nums is None or an empty list. Time Complexity: O(n) Space Complexity: O(n) """ if nums == None: return 0 if len(nums) == 0: return 0 max_sum = 0 current_sum...
d = list(map(int, input().split())) d.sort() if d[0] == d[1] and d[1] == d[2]: print(10000 + d[0] * 1000) elif d[0] == d[1]: print(1000 + d[0] * 100) elif d[1] == d[2]: print(1000 + d[1] * 100) else: print(100 * d[2])
# -*- coding: utf-8 -*- # author: Wu Mingchun """conf. 数据库配置文件 """ DATABASE = "mathsql" USER = "minch" PWD = "Wu12260917" HOST = "localhost" PORT = "5432"
# Aggregate all `python` rules to one loadable file load(":python_proto_compile.bzl", _python_proto_compile="python_proto_compile") load(":python_grpc_compile.bzl", _python_grpc_compile="python_grpc_compile") load(":python_grpclib_compile.bzl", _python_grpclib_compile="python_grpclib_compile") load(":python_proto_libra...
def initFont(name, w, h): # -> fontId imagep = Image.open(name) ix = imagep.size[0] iy = imagep.size[1] image = imagep.tobytes("raw", "RGBX", 0, -1) tid = texture_init(image, ix, iy) col_count = ix // w row_count = iy // h return { #'tid':tid, 'col':col_count, ...
# Returns length of LCS for X[0..m-1], Y[0..n-1] def longest_common_subsequence(X, Y): X_length = len(X) Y_length = len(Y) L = [[0 for x in range(Y_length + 1)] for x in range(X_length + 1)] # Following steps build L[m+1][n+1] in bottom up fashion. Note # that L[i][j] contains length of LCS of X[0....
################################################################################ # # Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors # # This file is a part of the MadGraph5_aMC@NLO project, an application which # automatically generates Feynman diagrams and matrix elements for arbitrary # h...
__all__ = ['directories', 'load_wfcorrection', 'mosaic_tools', 'wise_flux_correction']
dirfrom = open(r"C:\Users\emurphy24\Documents\GitHub\WoordleCalculator\dictfrom.txt", "r", encoding="utf-8") dirlist = [] for line in dirfrom: line = line.strip() dirlist.append(line) print(len(dirlist)) dirfrom.close() dirto = open(r"C:\Users\emurphy24\Documents\GitHub\WoordleCalculator\fiveletterdir"...
# Advent of Code Day 12 # https://adventofcode.com/2020/day/12 def heading_to_dir(heading): if heading == 0: return "N" elif heading == 90: return "E" elif heading == 180: return "S" elif heading == 270: return "W" def rotate_waypoint(old_north, old_east, degrees): ...
def test_home_page(test_client): """ GIVEN a Flask application WHEN the '/' page is requested (GET) THEN check the response is valid """ response = test_client.get('/') assert response.status_code == 200 assert b"Fantasy PLQ" in response.data assert b"Login" in response.data def te...
''' input: 123 -123 120 0 1534236469 Output 321 -321 21 0 0 ''' class Solution: def reverse(self, x: int) -> int: range_value = 2**31 val = x; output = "" if x < 0: output += "-" val = abs(val) while True: dig...
""" this is the application url path(s) """ __all__ = [ 'auth', 'postfix', 'dovecot', 'fetch' ]
print('========================') print(' BANCO CEV ') print('========================') while True: cont = 0 cont1 = 0 cont2 = 0 cont3 = 0 valor = int(input('Digite o valor a ser sacado: ')) print('') while valor < 1000: print('ERRO! Valor permitido a ser sacado a parti...
# Dragon sm.setSpeakerID(1013001) sm.sendNext("You, who is destined to be a Dragon Master... You have finally arrived.") sm.sendNext("Go and fulfill your duties as the Dragon Master...") #todo effects sm.warp(100030100, 0) sm.dispose()
def foo(): pass def bar(): pass def boing(): pass
""" Este es el comentario del archivo tarea2.py """
dict_month = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5, "F": 6, "G": 7, "H": 8, "I": 9, "J": 10, "K": 11, "L": 12, "M": 1, "N": 2, "O": 3, "P": 4, "Q": 5, "R": 6, "S": 7, "T": 8, "U": 9, "V": 10, "W": 11, "X": 12} dict_is_c...
#python 3 debug = False def from_input(): m = int(input()) idx_matrix = [] for _ in range(m): row = list(map(float, input().split())) idx_matrix.append(row) return idx_matrix def to_str(x): return list(map(lambda a: format(a, '.6f'), x)) def gauss(matrix): if len(matrix) == 0...
class Dog: kind = 'canine' # tricks = [] def __init__(self, name): self.name = name self.tricks = [] def add_trick(self, trick): self.tricks.append(trick) my_dog = Dog('Carl') my_dog.add_trick('roll over') another_dog = Dog('Max') another_dog.add_trick('play dead') print(my...
# reverse the order of the items in an array lista_unu = [1, 2, 3, 4, 5] def Reverse(list): list.reverse() return list print(Reverse(lista_unu)) # number of occurrences lista_doi = [1, 1, 1, 1, 4, 4, 6, 7, 9, 9, 9, 3] def NumberOfOccu(var, list): occ = 0 for i in list: if i == var: ...
# # PySNMP MIB module DLINK-PORT-SECURITY-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DLINK-PORT-SECURITY-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:35:02 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 ...
class Node: def __init__(self): self.data=None self.next=None class Linked_List(Node): def __init__(self): self.start=None def Create(self): while True: newnode=Node() newnode.data=int(input("Enter data part : ")) if self.start==None: ...
# ------------------- # Universal Exception # ------------------- class FontPartsError(Exception): pass
for i in range(2,10): flag=0 s=0 for j in range(2,i//2+1): if i%j==0: flag=1 break if flag==0: s+=i print('prime',i,s)
#!/usr/bin/env python # -*- coding:utf-8 -*- __author__ = 'wtq' MONGODB_HOST = '127.0.0.1' MONGODB_PORT = 27017 keywords = ['石油', '石化', '天然气', '的']
class RoadmapNode: def __init__(self, id, config): self.id = id self.config = config self.neighbors = [] def get_config(self): return self.config def get_id(self): return self.id ''' Add another RoadmapNode as neighbor. ''' def add_neighbor(self, node): ...
class AudioError(Exception): """ Any audio-related error. This is used as the base error type for all errors in the audio module. """ pass class MixerError(AudioError): """ An audio mixer IO error. An error that occurs while loading audio data from disk. """ pass class RequestError(AudioError): """ A TTS r...
model_source = 'bert-base-chinese' max_len = 512 num_workers = 2 batch_size = 32 # for training manual_seed = 1313 exp_name = 'bert_detection' train_json = 'data/aishell3_train.json' valid_json = 'data/aishell3_valid.json' lr = 5e-5 val_interval = 100 num_iter = 10000
# Aula 18 - Desafio 86: Matriz em Python # Criar uma matriz 3x3 e preencher com valores lidos pelo teclado. (tudo numa unica lista) # No final, a matriz na tela, com a formataçao correta. ''' 00 01 02 10 11 12 20 21 22 ''' matriz = [] coordenadas = [] for a in range(3): for b in range(3): coordenadas.appen...
#!/usr/bin/env python # coding: utf-8 def sort_blocks(): # First, we load the current README into memory with open('README.md', 'r', encoding='UTF8') as read_me_file: read_me = read_me_file.read() # Separating the 'table of contents' from the contents (blocks) table_of_contents = ''.join(read_...
for i in range(int(input())): s = input().split() if 'not' in s: print('Real Fancy') else: print('regularly fancy')
def gcd(a, b): """ a, b: two positive integers Returns the greatest common divisor of a and b """ if b == 0: return a return gcd(b, a % b) def general_poly (L): """ L, a list of numbers (n0, n1, n2, ... nk) Returns a function, which when applied to a value x, returns the val...
input = [ "17-19 p: pwpzpfbrcpppjppbmppp", "10-11 b: bbbbbbbbbbbj", "17-19 c: ccccccccccfrcctcccjc", "8-10 k: kkkkkkkfkkks", "13-14 l: lvllvllllslllv", "8-9 n: nhhcnnnknnqnb", "1-3 d: pdbdfbws", "5-6 v: vvvgvb", "7-8 x: gxcxtwbl", "2-15 r: xlgrwqpcsqtrvfrrt", "9-14 l: glnldl...
QUEUES_KEY = 'rq:queues' WORKERS_KEY = 'rq:workers' SUSPENDED_KEY = 'rq:suspended' QUEUE_NAMESPACE_PREFIX = 'rq:queue:' JOB_NAMESPACE_PREFIX = 'rq:job:' def queue_key_from_name(name): return QUEUE_NAMESPACE_PREFIX + name def queue_name_from_key(key): assert key.startswith(QUEUE_NAMESPACE_PREFIX) return k...
class Solution: def search(self, nums: List[int], target: int) -> int: if not nums: return -1 left, right = 0, len(nums) - 1 while left <= right: m = (left + right) // 2 if nums[m] == target: return m if nums[m] >= nums[left]: ...
# Leia uma temeperatura em graus Celsius e apresente-a convertida em graus Fahrenheit. # A formula de conversão é F = C * (9.0 / 5.0) + 32.0, sendo F a temperatura em Fahrenheit e C a temperatura em Celsius. C = float(input("Digite a temperatura em Celsius: ")) F = C * (9.0 / 5.0) + 32 print(f"A temperatura em Fahrenh...
# Write your solution for 1.3 here! n= 0 i= 0 while n <= 10000: i = i + 1 n = n + i print(i)
## ## Intro to Git, Python, and Programming Basics (bypassing XML) ## # going over some git basics # git --version # git help # Pull down a repo from somewhere # git clone <url> # git branches; discussed to some degree; means of doing changes off to side without affecting core code # then we can merge this stuff i...
#----------* CHALLENGE 19 *---------- #Ask the user to enter 1, 2 or 3. If they enter a 1, display the message “Thank you”, if they enter a 2, display #“Well done”, if they enter a 3, display “Correct”. If they enter anything else, display “Error message”. answer = int(input("Enter 1, 2 or 3: ")) if answer == 1...
# # liberator:configuration.py # # The Initial Developer of the Original Code is # Minh Minh <hnimminh at[@] outlook dot[.] com> # Portions created by the Initial Developer are Copyright (C) the Initial Developer. # All Rights Reserved. # #-------------------------------------------------------------------------------...
dic = { 'str' : { 'message_recevied' : ''' @client.event async def on_message(message): if message.content == '봇 종료' or message.content == '봇종료': await message.channel.send('안녀엉!') print('봇 종료됨.') exit() ''', 'if_message' : 'if message.content == "%_variable_%" and clie...
#9 type c str1=input('Enter the 1st String: ') str2=input('Enter the 2st String: ') if str1<str2: print(str2) else: l=len(str1) for x in range(l//2): print(' '*x+str1[x]+' '*(l-(2*(x+1)))+str1[-(x+1)])
__title__ = 'freeproxies' __description__ = 'Free proxies for humans' __url__ = 'https://github.com/iamkamleshrangi/freeproxies' __version__ = '0.0.1' __author__ = 'Kamlesh Kumar Rangi' __author_email__ = 'iamkamleshrangi@gmail.com' __license__ = 'GPL v3' __copyright__ = 'Copyright 2020 Kamlesh Kumar Rangi'
""" Write a Python function that returns the highest number in a list. input_list = [9,6,45,67,12] Expected output = 67 """ def high_num(input_list): input_list.sort() return input_list[-1]
# Sensor classes class SensCalPoly: # Polynomial calibration curve class def __init__(self, id, signalMin, signalMax, *args): self.id = id self.coeffs = [] for arg in args: self.coeffs.append(arg) self.signalMin = signalMin self.signalMax = signalMax def se...
# Crie um programa que leia o nome completo de uma pessoa e mostre # A- Nome com todas as letras maiusculas # B- O nome com todas as letras minusculas # C- Quantas letras ao todo(sem consideraças espaços) # D- Quantas letras tem o primeiro nome nome = str(input('Informe seu nome completo')).strip() print(nome.upper()...
num = 50 flag = True for i in range(2, num-1): if(num % i == 0): flag = False break if(flag == True): print("Prime number.") if(flag == False): print("Not a prime number.")
# This program is used to make a fibonacci sequence in a certain terms def fibonacci(term) : n1 = 0 n2 = 1 if(term <= 0) : print("Please, print with positive integer") elif(term == 1) : print(n1) else : print(n1) print(n2) count = 1 while(count <= te...
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: otp.distributed.PotentialShard class PotentialShard: __module__ = __name__ def __init__(self, id): self.id = id ...
class Move: def __init__(self, start_row, start_column, end_row, end_column): self.start_row = start_row self.start_column = start_column self.end_row = end_row self.end_column = end_column
""" 给出`R`行`C`列的矩阵,其中单元格的整数坐标是`(r, c)` 满足`0 <= r < R` 且`0 <= c < C` 另外,我们在该矩阵中给出了一个坐标为`(r0, c0)` 的单元格 返回矩阵中所有单元格的坐标,并按照`(r0, c0)`的距离从小到大的排序,其中, 两单元格`(r1, c1)` 和`(r2, c2)`之间的距离是曼哈顿距离: `| r1 - r2 | + |c1 - c2|` **test case** >>> R, C, r0, c0 = 1, 2, 0, 0 >>> allCellsDistOrder(R, C, r0, c0) [[0, 0], [0, 1]] >>> R, C, r...
print(EvolutionPhonetique.evolution_phonetique("AB")) # a print(EvolutionPhonetique.evolution_phonetique("A COSTÚDMÁRU")) # acotumé print(EvolutionPhonetique.evolution_phonetique("A DỌNC")) # adonc print(EvolutionPhonetique.evolution_phonetique("HÁBYO")) # ai print(EvolutionPhonetique.evolution_phonetique("ÁNTS")) ...
""" You are given two sets, and .Your job is to find whether set is a subset of set .If set is subset of set , print True. If set is not a subset of set , print False. Input Format The first line will contain the number of test cases, . The first line of each test case contains the number of elements in set . The...
'''This file holds the version of the project, according to Jira''' # starting ml modelling __version__ = '0.2.4'
""" DoF - Deep Model Core Output Framework -------------------------------------- Copyright rixel 2021 Distributed under the MIT License. See accompanying file LICENSE. """ # Modul level constants __author__ = ['Axel Ország-Krisz Dr.', 'Richárd Ádám Vécsey Dr.'] __copyright__ = "Copyright 2021, DoF - Deep Model Core...
""" Для чисел в пределах от 20 до 240 найти числа, кратные 20 или 21. Необходимо решить задание в одну строку. Подсказка: использовать функцию range() и генератор. """ def main(): new_list = [i for i in range(20, 241) if i % 20 == 0 or i % 21 == 0] print(new_list) print("Программа завершена") if __name...
#LeetCode problem 572: Subtree of Another Tree # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isSubtree(self, s: TreeNode, t: TreeNode) -> bool: ...
characterMapSean = { "sean_base_001": "sean_base_001", # Auto: Edited "sean_base_y_001": "", # Auto: Deleted "sean_ex_001_001": "sean_ex_001_001", # Auto: Edited ...
def getMinimumCost(k, c): n = len(c) x = n // k price = 0 for i in range(1 , x + 1): for _ in range(k): max_c = max(c) price += max_c * i c.remove(max_c) for j in c: price += j * (i + 1) return price print(getMinimumCost(3 , [2, ...
class InvalidResponseError(Exception): """APIレスポンスが想定外の場合に発行される例外 Parameters ---------- Exception : [type] APIレスポンスが想定外 """ pass
PATH = "path" SRC_PATH = "src_path" CONFIG_PATH = "config_path" USERNAME = "username" EMAIL = "email" ASSUMPTIONS_PATH = "ass_path" NOTES_PATH = "notes_path" TODOS_PATH = "todos_path" CONFIG_FILENAME = "config.json" ASSUMPTIONS_DIRNAME = "assumptions" NOTES_DIRNAME = "notes" TODOS_DIRNAME = "todos" INITIALIZED_FLAG =...
# sender, recipent and mail subject sender = 'sender@mail.com' recipent = 'recipent@mail.com' subject = 'New public IP address' # SMTP url and port smtpServer = 'smtp.mail.com:587' # credentials for your mail account username = 'sender@mail.com' password = 'password'
pizzas = ['Popcorn Shrimp Pizza ', 'Surf&Turf Pizza', 'BBQ Sausage Pizza'] for pizza in pizzas: print("I like " + pizza) print("I really love pizza!")
str = '懵萌猛梦' str = '这是添加的新内容' num =20 str = '这是在分支中修改的内容2'
""" Defines the template of a format handling backend Mainly a generic template to read and write functions. The registery of backends is located in backends/__init__.py """ #============================================================================== class BaseBackend(object): """ Template class for managing acc...
nome = str(input('Digite seu nome completo: ')).strip() print(f'Seu nome em maiúsculas é {nome.upper()}.') print(f'Seu nome em minúsculas é {nome.lower()}.') print(f"Seu nome tem ao todo {len(nome)-nome.count(' ')} letras.") print(f"Seu primeiro nome tem {nome.find(' ')} letras") ''' É possível fazer o último print de...