content
stringlengths
7
1.05M
''' 2 film olucak %50 şanslı İlk filmin 50 kışlık yeri ikincinin 80 kişilik yeri var İlkinin bileti 5 TL İkinci 14 TL İlk gişe Her 10 kişide ilkinin bileti %6 pahalanıyor ama 20 kişide bir %40 ücretsiz bilet şansı İkinci gişe Her 10 bilette %4 pahalanıyor ama 6 bilette bir %50 şansla menü kazanıyorsun (12tl gider ar...
"""https://github.com/biocommons/hgvs/issues/525""" def test_525(parser, am38): """https://github.com/biocommons/hgvs/issues/525""" # simple test case hgvs = "NM_000551.3:c.3_4insTAG" # insert stop in phase at AA 2 var_c = parser.parse_hgvs_variant(hgvs) var_p = am38.c_to_p(var_c) assert s...
description = 'Slit ZB0 using Beckhoff controllers' group = 'lowlevel' includes = ['zz_absoluts'] instrument_values = configdata('instrument.values') showcase_values = configdata('cf_showcase.showcase_values') optic_values = configdata('cf_optic.optic_values') tango_base = instrument_values['tango_base'] code_base =...
# Given an integer n, return true if it is possible to represent n as the sum of distinct powers of three. Otherwise, return false. # An integer y is a power of three if there exists an integer x such that y == 3x. def checkPowersOfThree(n): while n > 0: if n % 3 > 1: return False n //...
#!/usr/bin/python3.4 # -*- coding: utf-8 -*- """ This app calculates the accuracy of shots on goal in football Author: Alexander A. Laurence Last modified: January 2019 Website: www.celestial.tokyo """ # number of shots that didn't hit the goal shots_offTarget = input("How many shots did not hit the target? ") print...
""" # Implementation of all_keys function. * It will return all the keys present in the object. * It will also return the nested keys at all levels. """ __all__ = ["all_keys"] def _recursive_items(dictionary): """This function will accept the dictionary and iterate over it and yield all the ke...
def longest_increasing_subsequency(l: List) -> int: result = end = 0 for i in range(len(l)): if i > 0 and l[i - 1] >= l[i]: end = i result = max(result, i - end+1) return result print(longest_increasing_subsequency([3,5,7,2,1])) print(longest_increasing_subsequency...
""" Created on 3 Mar. 2018 @author: oliver """ class LineClassifier(object): """ classdocs """ def __init__(self, classification_description, line_collection): """ Constructor """ self._descr = classification_description self._collection = line_collection ...
train_data_path = "data/chunked/train/train_*" valid_data_path = "data/chunked/valid/valid_*" test_data_path = "data/chunked/test/test_*" vocab_path = "data/vocab" # Hyperparameters hidden_dim = 512 emb_dim = 256 batch_size = 200 max_enc_steps = 55 #99% of the articles are within length 55 max_dec_steps = 15 #...
""" Write a program to solve the following problem: You have two jugs: a 4-gallon jug and a 3-gallon jug. Neither of the jugs have markings on them. There is a pump that can be used to fill the jugs with water. How can you get exactly two gallons of water in the 4-gallon jug? """ def recursive_jugs(big_jug, little_ju...
#!/usr/bin/env python3 #coding:utf-8 class LNode(object): def __init__(self, x=None): self.val = x self.next = None def intersect(head1, head2): """ 方法功能:判断两个无环链表是否相交,若相交,则找出该结点 输入参数:head1 与 head2 分别为两个链表的头结点 返回值:若相交,返回该结点;若不相交,则返回 None """ if head1 is None or head1.next is ...
# from https://github.com/pyca/bcrypt/blob/3.1.7/tests/test_bcrypt.py # # Copyright 2013 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
question_data = [ { "category": "Entertainment: Japanese Anime & Manga", "type": "boolean", "difficulty": "easy", "question": "In the 1988 film "Akira", Tetsuo ends up destroying Tokyo.", "correct_answer": "True", "incorrect_answers": [ "False" ...
class EOLError(ValueError): """ Signals that the buffer is reading after the end of a line.""" class EOFError(ValueError): """ Signals that the buffer is reading after the end of the text.""" class TextBuffer: def __init__(self, text=None): self.load(text) def reset(self): self.l...
def do_helm(s): if not s.command_available('helm'): # https://docs.helm.sh/using_helm/#installing-the-helm-client s.send('curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash') s.send('helm init') s.send('kubectl get pods --namespace kube-system')
tuplas=("inacio","python","udemy") print(tuplas) print(tuplas[0]) print(tuplas[1]) print(tuplas[2]) print(tuplas[0:2]) print(tuplas+tuplas) print(tuplas*5) print(4 in tuplas) print("udemy" in tuplas) lista=[1,2,4,"inacio"] print(lista) tuplas2=lista print(tuplas2)
print('Conversor de moedas') print('e = Euros') print('d = Dollar') print('m = Pesos Mexicanos') print('a = Pesos Argentinos') print('l = Libras') moeda = input('Qual a moeda?: ') reais = float(input('Quantos em reais você gostaria de converter? ')) if reais <0: print('Quantidade inválida') elif moeda == 'e': ...
for char in "Hello, world!": for _ in range(0, ord(char)): print("+", end = "") print("[", end = "") print()
def read_settings_sql(cluster_descr, host_type): for settings_descr in cluster_descr.settings_list: if settings_descr.settings_type != host_type: continue yield from settings_descr.read_sql() # vi:ts=4:sw=4:et
input = """ 1 2 0 0 1 3 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 7 0 0 1 8 0 0 1 9 0 0 1 10 0 0 1 11 0 0 1 12 0 0 1 13 0 0 1 14 0 0 1 15 0 0 1 16 0 0 1 17 0 0 1 18 0 0 1 19 0 0 1 20 0 0 1 21 0 0 1 22 0 0 1 23 0 0 1 24 0 0 1 25 0 0 1 26 0 0 1 27 0 0 1 28 0 0 1 29 0 0 1 30 0 0 1 31 0 0 1 32 0 0 1 33 0 0 1 34 0 0 1 35 0 0 1 36 0 0 1...
"""This module provides Scala-like functional pattern matching in Python.""" __version__ = '0.1.3-dev' __author__ = 'Martin Blech' __copyright__ = '2012, ' + __author__ __license__ = 'MIT'
"""Rules for importing a Python toolchain from Nixpkgs. """ load("@bazel_skylib//lib:versions.bzl", "versions") load( "@rules_nixpkgs_core//:nixpkgs.bzl", "nixpkgs_package", ) load( "@rules_nixpkgs_core//:util.bzl", "ensure_constraints", "label_string", ) def _nixpkgs_python_toolchain_impl(reposit...
# Use this file to configure your DNA Center via REST APIs # Replace all values below with your production DNA Center information # DNA Parameters DNA_FQDN = "dna.fqdn" DNA_PORT = "443" DNA_USER = "admin" DNA_PASS = "password" DNA_SWITCHES = ["switch1", "switch2", "switch3"] # DNA API Calls DNA_AUTH_API = "/dna/syst...
x = 42 y = 3/4 z = int('7') a = float(5) name = "David" print(type(x)) print(type(y)) print(type(z)) print(type(a)) print(type(name)) rent = 2000 per_day = rent / 30 print(per_day) greeting = "My name is" print(greeting, name) print(greeting, name, f"My rent is {rent}") help(greeting)
# -*- coding: utf-8 -*- # @Time : 2021/5/24 11:00 PM # @Author: lixiaomeng_someday # @Email : 131xxxx119@163.com # @File : FS_01_algorithm.py """ name: fast slow pointers analysis: 在快速和慢速指针的方法,也被称为兔&龟算法,是一个指针算法使用两个指针以不同的速度移动, 其通过阵列(或序列/链表)通过以不同的速度移动(例如,在循环的LinkedList中), 该算法证明两个指针必然会合。一旦两个指针都处于循环循环中,则快速指针应...
def hello(): """ say hello only """ print('hello') def hi(): print("hi")
class Solution: def trapRainWater(self, heightMap): """ :type heightMap: List[List[int]] :rtype: int """ if not any(heightMap): return 0 heap = [] m, n = len(heightMap), len(heightMap[0]) seen = [[False] * n for _ in range(m)] for i...
"""HacsFrontend.""" class HacsFrontend: """HacsFrontend.""" version_running: bool = None version_available: bool = None version_expected: bool = None update_pending: bool = False
class Solution: def intToRoman(self, num: int) -> str: roman = {} roman[1000] = 'M' roman[900] = 'CM' roman[500] = 'D' roman[400] = 'CD' roman[100] = 'C' roman[90] = 'XC' roman[50] = 'L' roman[40] = 'XL' roman[10] = 'X' roman[9]...
""" 32 - Escreva um programa que leia o código do produto escolhido do cardápio de uma lanchonete e a quantidade. O programa deve calcular o valor a ser pago por aquele lanche. Considere que a cada execução somente será calculado um pedido. O cardápio da lanchonete segue o padrão abaixo: ESPECIFICAÇÃO | CÓDIGO...
# -*- coding: utf-8 -*-# #------------------------------------------------------------------------------- # PROJECT_NAME: design_pattern # Name: singleton.py # Author: 9824373 # Date: 2020-08-14 22:41 # Contact: 9824373@qq.com # Version: V...
# from .latexrun import __version__ = "0.1.0" __all__ = []
def memberGraph(): return { "nodes": [ { "id": 1, "label": "mbudiselicbuda", "shape": "circularImage", "image": "https://avatars.githubusercontent.com/u/4950251?s=88&v=4", "title": "Ovo je njonjo", "s...
delimiter = "|" eol = "\r\n" """ Header fields for json string """ field_market_data_request = "ReqMktData" field_position_data_request = "ReqPositionUpdates" field_account_data_request = "ReqAccountUpdates" field_order_data_request = "ReqOrderUpates" field_send_limit_order = "SendLimitOrder" field_send_market_order =...
""" Q212 Word Search II See also: Q079 Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more th...
def solve(arr): arr.sort() s = 0 for i in range(0, len(arr), 2): s += arr[i] return s
#! /usr/bin/python3.5 ### INSTRUCTIONS ### # instruction: ([chars list], has parameter, "representation in WIL") CHARS = 0 PARAM = 1 WIL = 2 STACK_INSTRUCTIONS = [ (['S'], True, 'push' ), (['L', 'S'], False, 'dup' ), (['T', 'S'], True, 'copy' ), (['L', 'T'], False, 'swap' ), (['L', 'L...
rows = 11 for i in range(0, rows): for j in range(0, i + 1): print(i * j, end= ' ') print()
''' leetcode 64. Minimum Path Sum 从左上角出发,到矩阵右下角,返回所有路径中的最小和 Input: 3 3 1 3 1 1 5 1 4 2 1 Output: 7 ''' m = int(input()) n = int(input()) matrix = [] for i in range(m): matrix.append(list(map(int,input().split()))) # print(matrix) for i in range(1,n): matrix[0][i] += matrix[0][i-1] for j in...
strings = input().split(", ") l = [(i, len(i)) for i in strings] print(', '.join([' -> '.join(map(str, m)) for m in l])) # #Решение на 1 ред: # # print(', '.join([' -> '.join(map(str, m)) for m in [(i, len(i)) for i in input().split(", ")]]))
class Mobile: def __init__(self): print("Mobile features: Camera, Phone, Applications") class Samsung(Mobile): def __init__(self): print("Samsung Company") super().__init__() class Samsung_Prime(Samsung): def __init__(self): print("Samsung latest Mobile") super().__in...
x = int(input()) print(x // 60) # получение целой части от деления, чтобы определить часы print(x % 60) # остаток от деления, чтобы определить минуты
# operações básicas primeiro_valor = input('Primeiro valor: ') if primeiro_valor.isnumeric is False: print(f'{primeiro_valor} não é um número válido') exit() operacao = input('Operação: ') segundo_valor = input('Segundo valor: ') if segundo_valor.isnumeric is False: print(f'{segundo_valor} não é um número ...
#========================example 1====================== #check a number if it can perfectly divide by n^2+1 fx = lambda n: (n**2+1)%5==0 k=int(input("please enter a number: ")) print(fx(k)) #========================example 2====================== findMax = lambda x,y: max(x,y) print(findMax(100,200))
class Err(Exception): """ Prints Project Error. * `error_origin`: (str) to specify from where the error comes. * `info_list` : (list) list of strings to print as message: each list item starts at a new line. """ def __init__(self, error_origin, info_list): Exception.__init__(self, error_...
class Snake: def __init__(self, SCREEN_LENGTH, MIDDLE_SCREEN): self.screen = SCREEN_LENGTH self.middle_screen = MIDDLE_SCREEN self.position = [self.middle_screen, self.middle_screen] self.body = [[self.middle_screen, self.middle_screen], [self.middle_screen - 10 , self.middle_screen]...
def fourSum(nums, target): def threeSum(nums, target): if len(nums) < 3: return [] res = set() for i, n in enumerate(nums): l = i + 1 r = len(nums) - 1 t = target - n while l < r: if nums[l] + nums[r] > t: ...
class Solution(object): def intersect(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: List[int] """ result = [] i, j = 0, 0 nums1 = sorted(nums1) nums2 = sorted(nums2) while i < len(nums1) and j < len(nums...
x = 1 while x < 20: # Tant que i est inférieure à 20 if x % 3 == 0: x += 4 # On ajoute 4 à i print("On incrémente x de 4") if x == 7: continue # On retourne au while sans exécuter les autres lignes print("x n'était pas égale à 7 mais à",x,"c'est pour ça qu'on est là\n") ...
class Shift: def __init__(self, id, ansvar, tid_fra, tid_til, antall_timer, weight, sted, antrekk): self.id = id self.responsibility = ansvar self.time_from = tid_fra self.time_to = tid_til self.hours = antall_timer self.weight = weight self.allocated = Fals...
''' The UndoController receives command objects (both simple and compound) from the Controllers It keeps a history list of operations The UI tells it when to call these stored commands ''' class UndoController: def __init__(self): # # History list of operations for undo/redo # self....
# 回收站选址 def st191202(): n=int(input()) dians=[] num=[0,0,0,0,0] for i in range(n): dians.append(list(map(int, input().split()))) # print(dians) for dian in dians: x = dian[0] y = dian[1] temp = 0 #当前点四个对角垃圾数 if [x, y + 1] in dians and [x, y - 1] in dians a...
BZX = Contract.from_abi("BZX", "0xfe4F0eb0A1Ad109185c9AaDE64C48ff8e928e54B", interface.IBZx.abi) TOKEN_REGISTRY = Contract.from_abi("TOKEN_REGISTRY", "0x5a6f1e81334C63DE0183A4a3864bD5CeC4151c27", TokenRegistry.abi) list = TOKEN_REGISTRY.getTokens(0, 100) for l in list: iTokenTemp = Contract.from_abi("iTokenTemp", ...
# -*- coding: utf-8 -*- """ __author__ = "Jani Yli-Kantola" __copyright__ = "" __credits__ = ["Harri Hirvonsalo", "Aleksi Palomäki"] __license__ = "MIT" __version__ = "1.3.0" __maintainer__ = "Jani Yli-Kantola" __contact__ = "https://github.com/HIIT/mydata-stack" __status__ = "Development" """ schema_account_new = { ...
class StoredAttachmentsManager: PROVIDER_ID_FIELD = 'id' URL_FIELD = 'url' CAPTION_FIELD = 'content' CREDIT_FIELD = 'excerpt' items_collection = 'attachments' response_collection = 'imported_images' original_key_fields = ['id', 'url'] # item = {i: original_item[i] for i in self.origi...
class EventException(BaseException): pass class EventCancelled(EventException): def __init__(self, evt): EventException.__init__(self) self.evt = evt class EventDeferred(EventException): pass class EventData(object): """Object passed into emitted events Attributes ------...
# https://www.hackerrank.com/challenges/acm-icpc-team def union(p1, p2): return [t1 | t2 for t1, t2 in zip(p1, p2)] def acm_icpc_team(persons): max_t, max_qty = 0, 0 for i, p1 in enumerate(persons): for j, p2 in enumerate(persons[(i + 1):], i + 1): t = sum(union(p1, p2)) ...
# Sets are unordered collection of objects # Creating Sets sets = {1, 2, 3, 4, 5} print(sets) print(type(sets)) hs = {1, 1.0, "Hello", True, (1, 2, 3)} print(hs) # We can't add duplicate elements in sets s = {1, 2, 3, 4, 2, 43, 2, 3, 4, 1} print(s) # create an empty set se = set() print(type(se)) # We can't declar...
# Challenge 10 : Create a function named reversed_list() that takes two lists of the same size as parameters named lst1 and lst2. # The function should return True if lst1 is the same as lst2 reversed. # The function should return False otherwise. # Date : Sun 07 Jun 2020 09:43:32...
@tf_export('compat.path_to_str') def path_to_str(path): r"""Converts input which is a `PathLike` object to `str` type. Converts from any python constant representation of a `PathLike` object to a string. If the input is not a `PathLike` object, simply returns the input. Args: path: An object that can be con...
__theme_meta__ = { 'author': "Baseline Core Team", 'title': "Baseline 2015", 'url': "https://github.com/loftylabs/baseline/", 'version': "0.1a", 'description': "The default Baseline theme.", }
#Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. # #The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. class Solution(object): def isValid(self, s): """ :type s: str :rtype: bool """ ...
class Cache(dict): # this class has some retarded methods like add_key but only i use it so not much of a problem @classmethod def from_dict(cls, other: dict): return cls(other) def insert(self, key, value): # this method allows you to do something like add_key([1, 2, 3], 4) and it wo...
''' Write a function that takes a non-empty array of distinct integers, and an integer representing a target sum. If any two numbers in the array sum upto the target sum, return the two numbers Else, return an empty array. ''' # Prompt: # Distinct & non-empty integer array # Returns two integers - any order ...
# Sets - A set is an unordered collection of items. # Creating Sets set_nums = {9, 10, 1, 4, 3, 2, 5, 0} set_empty = {} set_names = {'John', 'Kim', 'Kelly', 'Dora', False} # all (True if all items are true or empty set) print(" all - ".center(30, "-")) print('set_nums : ', all(set_nums)) print('set_nums2 : ', all(se...
"""Pika specific exceptions""" class AMQPError(Exception): def __repr__(self): return '%s: An unspecified AMQP error has occurred; %s' % ( self.__class__.__name__, self.args) class AMQPConnectionError(AMQPError): def __repr__(self): if len(self.args) == 2: return '{...
def square(number): """ return the square """ return number ** 2 print(square(5))
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, }, 'targets': [ { 'target_name': 'athena_main_lib', 'type': 'static_library', 'dependenc...
"""Tests that a failed pytest properly displays the call stack. Uses the output from running pytest with pytest_plugin_failing_test.py. Regression test for #381. """ def test_failed_testresult_stacktrace(): with open('testresult.txt') as f: contents = f.read() # before the fix, a triple quest...
''' Given a string s consisting of small English letters, find and return the first instance of a non-repeating character in it. If there is no such character, return '_'. Example For s = "abacabad", the output should be first_not_repeating_character(s) = 'c'. There are 2 non-repeating characters in the string: 'c' ...
{ "targets": [ { "target_name": "binding-helloworld", "sources": [ "src/cpp/binding-helloworld.cc" ] }, { "target_name": "binding-fibonacci", "sources": [ "src/cpp/binding-fibonacci.cc" ] } ] }
{ "targets": [{ "include_dirs" : [ "<!(node -e \"require('nan')\")" ], "defines": [ "PSAPI_VERSION=1", "METRO_APPS=1" ], "libraries": ["-lPsapi"], "target_name": "whoisopen", "sources": ["src/whoisopen.cc"] }] }
# The read4 API is already defined for you. # @param buf, a list of characters # @return an integer # def read4(buf): class Solution(object): def __init__(self): self.queue = collections.deque() def read(self, buf, n): """ :type buf: Destination buffer (List[str]) ...
""" Defines the Union-Find (or Disjoint Set) data structure. A disjoint set is made up of a number of elements contained within another number of sets. Initially, elements are put in their own set, but sets may be merged using the `unite` operation. We can check if two elements are in the same seet by comparing their ...
#!/usr/bin/env python """ Drop, create table statements generators from 'SqlTable' objects. """ __author__ = "Yaroslav Litvinov" __copyright__ = "Copyright 2016, Rackspace Inc." __email__ = "yaroslav.litvinov@rackspace.com" INDEX_ID_IDXS = 'a' INDEX_ID_PARENT_IDXS = 'b' INDEX_ID_ONLY = 'c' def generate_drop_table_s...
def arr_mult(A,B): new = [] # Iterate over the rows of A. for i in range(len(A)): # Create a new row to insert into the product. newrow = [] # Iterate over the columns of B. # len(B[0]) returns the length of the first row # (the number of columns). for j in r...
""" File: rocket.py Name: Fangching Su ----------------------- This program should implement a console program that draws ASCII art - a rocket. The size of rocket is determined by a constant defined as SIZE at top of the file. Output format should match what is shown in the sample run in the Assignment 2 Hando...
print('Exercício Python #015 - Aluguel de Carros') a8 = float(input('Quantos dias o carro ficou alugado? ')) b8 = float(input('Quantos Km ele andou? ')) c8 = (a8 * 60) + (b8 * 0.15) print(' Sendo {:.0f} dias e {} Km rodados, o valor do aluguel será R$ {}'.format(a8, b8, c8))
def pandigital_generator(): for perm in itertools.permutations(range(0,10)): if perm[0] != 0: yield functools.reduce(lambda x,y: x*10 + y, perm) def prime_generator(): yield 2 yield 3 yield 5 yield 7 yield 11 yield 13 yield 17 def has_p043_property(n): n_str = s...
n1 = float(input('Primeira nota: ')) n2 = float(input('Segunda nota: ')) media = (n1 + n2) / 2 print('Tirando {:.1f} e {:.1f}, a media do aluno é {:.1f}'.format(n1, n2, media)) if 7 > media >= 5: print('O Aluno está em Recuperação!!') elif media < 5: print('O Aluno está Reprovado!') elif media >= 7: print('...
class PluginBase: instances = [] def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) cls.instances.append(cls()) def hello() -> list: results = [] for i in PluginBase.instances: results.append(i.hello()) return results class Pl...
def write_table_row(key, value): row = f"<tr><td>{key}</td><td>{value}</td></tr>" return row def write_doc_entry(idx, domain): fields = domain.get("fields") doc_entry = f'<tr><th colspan="2">Link {idx}</th></tr>' doc_entry += write_table_row( "URL", f"<a target=\"_blank\" rel=\"noo...
# https://www.codewars.com/kata/how-good-are-you-really def better_than_average(class_points, your_points): counter = 0 sum = 0 output = True for i in class_points: sum += i counter += 1 if sum / counter >= your_points: output = False return output
# -*- coding: utf-8 -*- """ Model Map table building_use :author: Sergio Aparicio Vegas :version: 0.1 :date: 14 Sep. 2017 """ __docformat__ = "restructuredtext" class BuildingUse(): """ DB Entity building_use to Python object BuildingUse """ def __init__(self): self.__id = 0...
''' Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [1,2,3,4,5] Output: [5,4,3,2,1] Example 2: Input: head = [1,2] Output: [2,1] Example 3: Input: head = [] Output: [] Constraints: The number of nodes in the list is the range [0, 5000]. -5000 <= Nod...
def dig_str(n): lista = [] st = str(n) for i in range(len(st)): lista.append(st[i]) return(sorted(lista)) def comparador_de_digitos(x,y): if dig_str(x) == dig_str(y): return(1) else: return(0) N = 1 while(True): if comparador_de_digitos(N, 2 * N) == 1 and comparador_de_digitos(N, 3 * N) == 1 and comparad...
''' Author : MiKueen Level : Medium Problem Statement : Coin Change 2 You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that amount. You may assume that you have infinite number of each kind of coin. Example 1: Input: amou...
gitdownloads = { "opsxcq": ("exploit-CVE-2017-7494", "exploit-CVE-2016-10033"), "t0kx": ("exploit-CVE-2016-9920"), "helmL64": "https://get.helm.sh/helm-v3.7.0-linux-amd64.tar.gz", "helmW64": "https://get.helm.sh/helm-v3.7.0-windows-amd64.zip" } helmchartrepos = { "gitlab": "helm repo add gitlab http...
''' Kattis - primematrix Constructive problem, first we find a set of distinct positive integers that sum to a prime number such that the maximum number is minimised. Then the matrix can be constructed by printing all lexicographical rotations of the set of numbers. To find this set of numbers, given the bounds of th...
""" File: hailstone.py Name: Peter Lin ----------------------- This program should implement a console program that simulates the execution of the Hailstone sequence, defined by Douglas Hofstadter. Output format should match what is shown in the sample run in the Assignment 2 Handout. """ def main(): """ defi...
def validate_password(password: str): if len(password)<8: return False for i in password: if i.isdigit(): return True return False
# Common test data used by multiple tests AUTH_ARGS = { 'client_id': 'cats', 'client_secret': 'opposable thumbs', 'access_token': 'paw', 'refresh_token': 'teeth', }
{ "targets": [ { "target_name": "itt", "sources": [ "itt-addon.cc" ], "include_dirs": [ "include", "C:\\Program Files (x86)\\IntelSWTools\\VTune Profiler 2020\\include" ], "libraries": [ "C:\\Program Files (x86)\\IntelSWTools\\VTune Profiler 2020\\lib64\\libittnotify....
class Solution: def maxAreaOfIsland(self, grid): """ :type grid: List[List[int]] :rtype: int """ ans = 0 if not grid: return ans ans = 0 def dfs(grid, r, c): if grid[r][c] == 0: return 0 grid[r][c] ...
ranges ={ 'temp':{'min':1,'max':45},#Temperature 'soc':{'min':20,'max':80},#state of Charge 'charge_rate':{'min':0,'max':0.8},#state of Charge } test_report=[] test_case_id=0 def append_list(src_list,dst_list): for x in src_list: dst_list.append(x) def min_range_test(value,range_min): result=Fal...
class SomeClass: def __init__(self, name='lin'): self.name = name # def get_name(self): # return self.name def get_name_new(): return self.name
""" Exercise Python 069: Crie um programa que leia a idade e o sexo de várias pessoas. A cada pessoa cadastrada, o programa deverá perguntar se o usuário quer ou não continuar. No final, mostre: A) quantas pessoas tem mais de 18 anos. B) quantos homens foram cadastrados. C) quantas mulheres tem menos de 20 anos. """ ...
# ___ ___ # | _ \ | _ \ # ___ __ __ || || ||_|| #_\/_ | | ||__| __ || || |___/ _\/_ # /\ | |__|| || || | _ \ /\ # ||_|| ||_|| # |___/ |___/ # __version__ = '2.0.7'
x = 10 y = 1 color = 'blue' first_name = 'Julian' last_name = 'Henao' # < > <= <= == if x < 30: print('X is less than 30') else: print('X is greater than 30') if color == 'red': print('The color is red') else: print('Any color') if color == 'yellow': print('The color is yellow') elif color == 'b...
class Solution(object): def numIdenticalPairs(self, nums): """ :type nums: List[int] :rtype: int """ count = 0 for i in range(len(nums)): for j in range(len(nums)): if nums[i] == nums[j] and i < j: count += 1 ret...