content
stringlengths
7
1.05M
# -*- coding: utf-8 -*- # Copyright (c) 2019, Silvio Peroni <essepuntato@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice # and this permission notice appear in all copies. # # THE SOFTWARE I...
print("Witamy w generatorze nazw zespołów") city = input("Podaj miasto, w którym się urodziłeś\n") pet = input("Podaj imię swojego pupila\n") print("Nazwa twojego zespołu powinna brzmieć: " + city + " " + pet)
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non...
class EvenIterator(object): def __init__(self,collection): self.iter = iter(collection[::2]) def __iter__(self): return self def __next__(self): return next(self.iter) if __name__=="__main__": for i in EvenIterator([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]): print(i)
# # PySNMP MIB module CISCO-UNIFIED-COMPUTING-FSM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-UNIFIED-COMPUTING-FSM-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:59:37 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Pytho...
numero = int(input("Digite o valor de n:")) x = 1 i = 1 while x <= numero: print(i) i = i+2; x=x+1
data = [ {'text':'oh hi duuuude how r uy??check this 1xbet'}, {'text':'Dear Harry Potter, i am Frodo Baggins i represent 1xbet company.Best bet service'}, {'text':'wooooh yoow harry look at my jackpot 100000000$ at 1xbet service'}, {'text':'Harry , today i saw the man who looks like Hawkeye from Avenger...
dist = int(input("Qual é a distância da sua viagem? ")) print(f'Você está prestes a iniciar uma viagem de {dist:.2f} Km.') if dist <= 200: preco = dist * 0.5 else: preco = dist * 0.45 # Outra opção, simplificada # preco = dist * 0.5 if dist <= 200 else dist * 0.45 print(f'E o preço da sua passagem será de R$...
"""dots: dotfiles made easy """ __version__ = "0.0.1a0"
# # PySNMP MIB module BAY-STACK-LLDP-EXT-DOT3-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BAY-STACK-LLDP-EXT-DOT3-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:35:40 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python versio...
class proxy(ref): def __call__(self, *args, **kwargs): func = ref.__call__(self) if func is None: raise weakref.ReferenceError('referent object is dead') else: return func(*args, **kwargs) def __eq__(self, other): if type(other) != type(self): ...
# Generated file, do not modify by hand """Definitions to be used in rbe_repo attr of an rbe_autoconf rule """ _TOOLCHAIN_CONFIG_SPECS = [] _BAZEL_TO_CONFIG_SPEC_NAMES = {} LATEST = "" CONTAINER_TO_CONFIG_SPEC_NAMES = {} _DEFAULT_TOOLCHAIN_CONFIG_SPEC = "" TOOLCHAIN_CONFIG_AUTOGEN_SPEC = struct( bazel_to_config_sp...
produtos = ('Pão Francês', 11.58, 'Mortadela Perdigão', 6.34, 'Leite Jussara', 3.65, 'Banana', 4.56, 'Ovo', 8.75, 'Iorgute', 4.89) nada = '\033[m' titulo = '\033[01;34m' txt = '\033[34m' tamanho = float(len(produtos)) / 2 print(f'\n{titulo :-<20} LISTA DE PREÇOS {nada :->15}') for count in range(0, int(tamanho)): ...
usuario = "Esteban" contrasena = "12345bla" print("inserte un nombre de usuario") n_usuario = input() print("inserte un su contraseña") n_contrasena = input() if usuario == n_usuario and contrasena == n_contrasena: print(usuario + "has iniciado sesion") else: print("usuario o contraseña incorrectas")
""" None """ class Solution: def lengthOfLongestSubstringKDistinct(self, s: str, k: int) -> int: counter = {} start = 0 m_len = 0 for i, c in enumerate(s): if c not in counter: counter[c] = 1 else: counter[c] += 1 ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
loop_flag = False def consult_check(consult, doctor, upper, lower): doc_test = doctor in {'Dr A Wettstein', 'Dr S Ghaly', 'Dr S Vivekanandarajah'} path = upper in {'pb', 'pp'} or lower in {'cb', 'cp', 'sb', 'sp'} cv_test = (doctor == 'Dr C Vickers') and path return doc_test o...
def insertion_sort(array): for index in range(1,len(array)): value = array[index] i = index - 1 while i >= 0: if array[i] > array[i+1]: array[i+1] = array[i] array[i] = value i = i - 1 else: break return array if __name__ == '__main__': array = [0,2,1,3,6,4,...
#!/usr/bin/env python3 RIGHT = 'R' LEFT = 'L' FORWARD = 'F' NORTH = 'N' EAST = 'E' SOUTH = 'S' WEST = 'W' DIRECTIONS = { 'N': (0, 1), 'E': (1, 0), 'S': (0, -1), 'W': (-1, 0) } COMPASS = { 0: 'N', 90: 'E', 180: 'S', 270: 'W' } def parse(step): return (step[0], int(step[1:])) def...
def main(): def welcome(): # welcome function print("==================================================================================") print("Hi this is a Cryptograph encoder which u can use to Encrypt or Decrypt messages") print("======================================================...
#!/usr/bin/python #coding=utf-8 class RequestTmBase: def addRecode(self, ssp, url, tmSpan, state, concurrency,countPer10s,size): raise NotImplementedError def startRecode(self): raise NotImplementedError def startServer(self): raise NotImplementedError def endRecode(self): raise NotImplementedE...
""" __version__.py ~~~~~~~~~~~~~~ Information about the current version of firemelon package. """ __title__ = "firemelon" __description__ = "firemelon — Simple Password Generator" __version__ = "1.1.4" __author__ = "evtn" __author_email__ = "g@evtn.ru" __license__ = "MIT License" __url__ = "https://github.com/evtn/fi...
""" Exceptions for the pystrike module. """ class ConnectionException(Exception): """ Raised when the client is unable to communicate with the indicated host. This exception could indicate that the client is unable to contact the indicated host, or it could indicate that the client was unable ...
class Solution: def sumEvenAfterQueries(self, A, queries): # keep around total sum, we update (if we find evens) on # each iteration. evenSum = sum(i for i in A if i & 1 == 0) for idx, (value, index) in enumerate(queries): old_value = A[index] new_value = valu...
""" Objective In this challenge, we're going to use loops to help us do some simple math. Check out the Tutorial tab to learn more. Task Given an integer, N, print its first 10 multiples. Each multiple N * i (where 1 <= i <= 10) should be printed on a new line in the form: N x i = result. """ N = int(input().strip()...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2022/2/21 class OperationLog: """ append only write operation log """ pass
""" Module: 'ucryptolib' on LEGO EV3 v1.0.0 """ # MCU: sysname=ev3, nodename=ev3, release=('v1.0.0',), version=('0.0.0',), machine=ev3 # Stubber: 1.3.2 class aes: '' def decrypt(): pass def encrypt(): pass
# -*- coding: utf-8 -*- """ciscosparkapi exception classes.""" __author__ = "Chris Lunsford" __author_email__ = "chrlunsf@cisco.com" __copyright__ = "Copyright (c) 2016 Cisco Systems, Inc." __license__ = "MIT" SPARK_RESPONSE_CODES = { 200: "OK", 204: "Member deleted.", 400: "The request was invalid or c...
def get_layers(width, height, data): layers = [] layer_area = width*height data = [pixel for pixel in str(data)] data.remove('\n') while len(data) > 0: layers.append(data[:layer_area]) data = data[layer_area:] return layers WIDTH = 25 HEIGHT = 6 layers = get_layers(WIDTH, HEIGH...
# ============================================================================= # Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/ # FileName: 10494.py # Description: UVa Online Judge - 10494 # ============================================================================= while True:...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def __init__(self): self.tree_node = [] self.res = 0 def pathSum(self, root, sum): """ :type roo...
MAX_VAL = 2**31+1 def main(): n_ints = int(input()) ints = [int(x) for x in input().split()] # Find all potential pivots by iterating from the left side. highest = ints[0] potential_pivots = set() for i in ints: if i >= highest: potential_pivots.add(i) highest =...
""" Data structures """ class SymmetryData: def __init__(self): self.number_of_species = -1 self.structure = None self.space_group = -1 self.point_group = -1
one = { 'r': { '__type__': 'tf.truncated_normal', '__pre__': [], 'dtype': 'tf.float32', 'shape': [2, 2], 'name': '\'r\'' }, 'w': { '__type__': 'tf.Variable', '__pre__': ['r'], 'dtype': 'tf.float32', 'initial_value': 'r', 'name': '\'w\'' }, 'x': { '__type__': 'tf.placeholder', '__pre__': [],...
"""Constants for pypresseportal.""" MEDIA_TYPES = ("image", "document", "audio", "video") PUBLIC_SERVICE_MEDIA_TYPES = ("image", "document") RESSORTS = ("wirtschaft", "politik", "sport", "kultur", "vermischtes", "finanzen") SECTORS = ( "arbeit", "auto", "banken", "bauwesen", "bildung", "celebri...
# -*- coding: utf-8 -*- tag2struct = {u"#": "R_HEADER" ,u"£": "RDR_HEADER" ,u"µ": "RDR_DRAFT" }
# -*- coding:utf-8 -*- #保存文件地址 FILE_DIR = '/home/scrapy/wyzw/file'
# automatically generated by the FlatBuffers compiler, do not modify # namespace: zkinterface class Message(object): NONE = 0 Circuit = 1 R1CSConstraints = 2 Witness = 3
""" A set of PyQt distutils extensions for build qt ui files in a pythonic way: - build_ui: build qt ui/qrc files """ __version__ = '0.7.3'
print('='*10, 'Desafio Python 27','='*50) nome = str(input('Digite seu nome completo: ')) nome = nome.strip() nome = nome.upper() print('O seu nome completo é {}.'.format(nome)) nome = nome.split() print('O seu primeiro nome é {}.'.format(nome[0])) print('O seu ultimo nome é {}.'.format(nome[-1])) print('='*10, 'Desaf...
class Dawg (object): def __init__(self, digraphs=[]): self.root = self.index = 0 self.digraphs = digraphs self.graph = {self.root: []} self.accepts = {} def tokenize(self, word): return self._rtokenize(word, []) def insert(self, word): self._rinsert(self.root, self.tokenize(word), word)...
#!/usr/bin/env python3 # #Copyright 2022 Kurt R. Brorsen # # 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/LICENSE-2.0 # # Unless required by a...
''' The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p...
# -*- coding: utf-8 -*- class Node: def __init__(self, val, isLeaf, topLeft, topRight, bottomLeft, bottomRight): self.val = val self.isLeaf = isLeaf self.topLeft = topLeft self.topRight = topRight self.bottomLeft = bottomLeft self.bottomRight = bottomRight def ...
''' @Author: Hata @Date: 2020-07-30 09:27:42 @LastEditors: Hata @LastEditTime: 2020-07-30 09:29:33 @FilePath: \LeetCode\M02-04.py @Description: https://leetcode-cn.com/problems/partition-list-lcci/ ''' # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.n...
print("{:_^20}".format("School average")) FirstGrade = float(input("First Grade: ")) SecondGrade = float(input("Second Grade: ")) Media = (FirstGrade + SecondGrade) / 2 print("Media: {:.1f}".format(Media)) print("{:_^20}".format("School average 2")) FirstGrade = float(input("First Grade: ")) SecondGrade = float(i...
""" A system log management tool with time-series causal analysis """
class BaseException(Exception): code = 0 message = '' def __init__(self, code, message): self.code = code self.message = message class ServerException(BaseException): def __init__(self, message): super().__init__(500, message) class ClientException(BaseException): def __...
# Copyright (c) 2020 jya # # 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/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
UNTRACKED_PATH = "repositorios" COMPILER = "pdflatex" SAE_COUNTER_GITHUB = "https://github.com/comissao-aerodesign/PyAeroCounter.git" SAE_COUNTER_PATH = "PyAeroCounter" PROJECTS_OVERLEAF = [ { 'name': "<Nome do projeto>", 'path': "<Pasta_do_projeto>", 'main': "<Arquivo tex>", 'url...
def test(function, arguments_result_list, one_argument_function=False): """ testing function for every (arguments,expected_result) pair in arguments_result_list checks if function(arguments) == result """ for args, expected_result in arguments_result_list: if one_argument_function: ...
def get_entity_bios(seq,id2label): """Gets entities from sequence. note: BIOS Args: seq (list): sequence of labels. Returns: list: list of (chunk_type, chunk_start, chunk_end). Example: # >>> seq = ['B-PER', 'I-PER', 'O', 'S-LOC'] # >>> get_entity_bios(seq) [[...
class AppValidationError(Exception): def __init__(self, msg, response=None): super(AppValidationError, self).__init__(msg) self.response = response
# ---------------------------------------------------------------------------- # Copyright (c) 2017-, labman development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------------------...
# import random # class InvalidGreetingException(Exception): # """ # Raised when a string does not imply greeting # """ # pass # def main(): # """ # Doc string.Girish # """ # greeting_messages = ["Hello", "Welcome", "Hey", "Hi"] # choices = greeting_messages + ["Bye", "Thanks",...
#program to sort a list of elements using Comb sort. def comb_sort(nums): shrink_fact = 1.3 gaps = len(nums) swapped = True i = 0 while gaps > 1 or swapped: gaps = int(float(gaps) / shrink_fact) swapped = False i = 0 while gaps + i < len(nums): if nums[...
#!/usr/bin/env python # I need to figure out how I want to deal with these classes class FacebookEndpoint: pass
def is_phone_number(text): """ This function was made to recognize a Brazilian phone number :param text: number :return: """ # normally, brazilians use the format +00 (00) 00000-0000 the brazilian code is +55, in the beginning disallowed_characters = '+() -' for character in disallowe...
sns.relplot( data=monthly_victim_counts, kind="line", palette="colorblind", height=3, aspect=4, )
""" Dictionary: 1. Normal variable holds 1 value; dictionary holds collection of key-value pairs; all keys must be distinct but values may be repeated 2. {} - curly bracket 3. Unordered 4. Mutable 5. uses Hashing internally 6. Functions: 1. dict[] : returns value at specified index 2. len() ...
#coding=utf-8 #检查用户名P79 2017.4.14 current_users = ['jer','cas','ety','a','b'] new_users = ['JER','Cas','x','y','z' ] for new_user in new_users: if new_user.upper() in current_users: print('Sorry!The username '+new_user.title()+' has been used,You must change your input!') elif new_user.title() in current_user...
# https://www.codechef.com/problems/FLOW015 for T in range(int(input())): n,days,c=int(input()),['sunday','monday','tuesday','wednesday','thursday','friday','saturday'],1 if(n>2001): for z in range(2002,n+1): if((z-1)%4==0 and ((z-1)%400==0 or (z-1)%100!=0)): c+=2 else: c+=1 ...
#In this file I am going to model a Spotify playlist playlist ={ 'name':'hip-hop', 'author':'John', 'songs' : [ { 'title':'Walk it Talk it', 'artist': 'Migos', }, { 'title':'New Freezer', 'artist' : 'Rich Kid', }, { 'title':'New Freezer', 'artist':'Chris Brown', } ], } for song in playlist['songs']...
load("@bazel_gazelle//:deps.bzl", _go_repository = "go_repository") load("@io_bazel_rules_go//go:def.bzl", _go_binary = "go_binary", _go_library = "go_library", _go_test = "go_test") def go_repository(name, **kwargs): """Macro wrapping the Gazelle go_repository rule. This conditionally defines the repository ...
# -*- coding: utf-8 -*- """ File Name: best-line-lcci.py Author : jynnezhang Date: 2020/11/12 11:45 下午 Description: https://leetcode-cn.com/problems/best-line-lcci/ """ class Solution: def bestLine(self, points): ret = {} for i in range(len(points)): for j in range(i + ...
# Numbers can be combined using mathematical operators x = 1 + 1 y = 2 * 3 # Variables holding numbers can be used any way numbers can be used z = y / x # We can prove that these computations worked out the same # using comparison operators, specifically == to test for equality: print('===comparing===') print('2 == x...
class Solution: def kthFactor(self, n: int, k: int) -> int: count = 0 for i in range(1,n+1): if n%i==0: count+=1 if count==k: return i return -1
{ 'name': 'Junari Odoo Website Utils', 'version': '1.0', 'summary': 'Re-usable widgets for odoo website modules', 'author': 'Junari Ltd', 'category': 'CRM', 'website': 'https://www.junari.com', 'images': [], 'depends': [ 'website' ], 'data': [ 'views/assets.xml' ...
while True: num = int(input('Quer ver a tabuada de qual valor? ')) if num < 0: break print('-' * 30) for mult in range(1, 11, 1): print(f'{num} x {mult} = {num * mult}') print('-' * 30) print('PROGRAMA TABUADA ENCERRADO. Volte sempre!')
class Humidifier: """Class that represents a humidifier object in the Venta API.""" def __init__(self, request): """Initialize a humidifier object.""" self.state = {} self.request = request self.update() # Note: each property name maps the name in the returned data @p...
""" Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Output: true Explanation: 24 = 16 Example 3: Input: 218 Output: false Solution: 1. While loop and Divide by 2 2. Bit Manipulation a power of two in binary represe...
# -*- coding: utf-8 -*- class Duck(object): def quark(self): print('Quaaaaaark!') class Person(object): def quark(self): print('Hello!') def quarking(duck): try: duck.quark() except AttributeError: pass if __name__ == '__main__': duck = Duck() person = Person...
# -*- coding: utf-8 -*- """ smallparts.constants - common constants """ # # Single character constants # AMPERSAND = '&' ASTERISK = '*' AT = '@' BLANK = SPACE = SP = ' ' BRACE_OPEN = '{' BRACE_CLOSE = '}' COLON = ':' COMMA = ',' CARRIAGE_RETURN = CR = '\r' DASH = '-' DOT = '.' DOUBLE_QUOTE = '"' EMPTY = '' EQUALS...
DATA = [ ("Load JS/WebAssembly", 2, 2, 2), ("Load /tmp/lines.txt", 225, 222, 218), ("From JS new Fzf() until ready to ....", 7825, 8548, 1579), ("Calling fzf-lib's fzf.New()", 1255, 3121, 963), ("return from fzfNew() function", 358, 7, 0), ("search() until library has result", 4235, 1394, 1...
extenso = 'zero', 'um', 'dois', 'três', 'quatro', 'cinco',\ 'seis', 'sete', 'oito', 'nove', 'dez',\ 'onze', 'doze', 'treze', 'catorez', 'quinze',\ 'dezesseis', 'dezessete', 'dezoito', 'dezenovo,', 'vinte' while True: while True: n = int(input('Digite um número entre 0 e 20: '))...
''' Copyright (C) 2015 Dato, Inc. All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' graphlab_server = 'http://pws-billing-stage.herokuapp.com' mode = 'QA' mixpanel_user = '97b6ae8fe096844c2efb9f6c57165d41' metrics_url = 'http:...
class BaseValidator: REQUIRED_KEYS = [] def validate(self, data): return all( key in data.keys() for key in self.REQUIRED_KEYS) class UserValidator(BaseValidator): REQUIRED_KEYS = ('username', 'password') class PotionValidator(BaseValidator): REQUIRED_KEYS = ('name')...
def poisson(i, j, u_tp, v_tp, dx, dy, dt, P, c, SOR): cm = ( u_tp[i, j] - u_tp[i-1, j] + v_tp[i, j] - v_tp[i, j-1] ) # conservation of mass pressure = (P[i+1, j] + P[i-1, j] + P[i, j+1] + P[i, j-1]) P[i, j] = SOR * (c[i, j])*(pressure - (dx/dt)*(cm)) + (1.0 - SOR) * P[i, j] return ...
AWS_REGION = 'us-east-1' #Lambda function name for querying lambda_func_name = "cloudtrailTrackerQueries" #Lambda function name for automatic event uploads lambda_func_name_trigger = "cloudtrailTrackerUploads" #Stage name for API Gateway stage_name = "cloudtrailtrackerStage" #DynamoDB Table name table_name = "cloudtrai...
SETUP_TIME = -1.0 INTERMED_FILE_FILEEXT = '.txt' SEPERATOR = '_' SETUP_SCRIPT_POSTFIX = "_setup.sh" RUNTIME_SCRIPT_POSTFIX = "_runtime.cmd"
# 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 zigzagLevelOrder(self, root: Optional[TreeNode]) -> List[List[int]]: if not root: return [] ...
#title :matchmaker_nance.py #description :This will ask a series of questionsd and determine match %. #author :Chris Nance #date :2022-03-13 #version :1.0 #usage :python matchmaker_nance.py #notes :Edit the questionAndAnswerDict Dictionary below. #python_ver...
# finding bottom left value if binary search tree class Node: def __init__(self,val): self.left = None self.right = None self.val = val def findBottomLeftValue(root): current = [] # contains nodes are current level parent = [] # contains nodes at previous level current...
class DSSConstants(object): APPLICATION_JSON = "application/json;odata=verbose" APPLICATION_JSON_NOMETADATA = "application/json;odata=nometadata" AUTH_LOGIN = "login" AUTH_OAUTH = "oauth" AUTH_SITE_APP = "site-app-permissions" CHILDREN = 'children' DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ" D...
#Faça um Programa que peça um valor e mostre na tela se o valor é positivo ou negativo. value = int(input("Informe um número inteiro: ")) if value < 0: print(f"{value} é um valor negativo!") elif value > 0: print(f"{value} é um valor positivo!") else: print(f"{value} é um valor nulo!")
# This is an example script Import("projenv") # access to project construction environment print(projenv) # Dump construction environments (for debug purpose) print(projenv.Dump()) # append extra flags to only project build environment projenv.Append(CPPDEFINES=[ "PROJECT_EXTRA_MACRO_1_NAME", ("PROJECT_EXTRA_MA...
class Inventory: def __init__(self,unRealize,nowPrice,stockno,stockname,amount,price): self.__stockno = stockno self.__stockname = stockname self.__amount = amount self.__price = price self.__unRealize = unRealize self.__nowPrice = nowPrice @property def stockno(self): return self.__stockno @property...
def electionsWinners(votes, k): m = max(votes) n = len(list(filter(lambda y: y, (map(lambda x: (x + k) > m, votes))))) votes.remove(max(votes)) if n == 0 and m > max(votes): return 1 return n
''' 1. Write a Python program to calculate the length of a string. 2. Write a Python program to count the number of characters (character frequency) in a string. Sample String : google.com' Expected Result : {'o': 3, 'g': 2, '.': 1, 'e': 1, 'l': 1, 'm': 1, 'c': 1} 3. Write a Python program to get a s...
'''#while cont = soma = media = maior = menor = 0 continuar = 'S' while continuar in 'Ss': numero = int(input('Digite um valor: ')) cont += 1 soma += numero #maior e menor if cont ==1: maior = menor = numero else: if numero > maior: maior = numero elif numero < m...
class Point(object): def __init__(self, x, y): self.x = x self.y = y def ToString(self): return '("+x+", "+y+")'
def _repo_path(repository_ctx): return repository_ctx.path(".") def _get_depot_tools(repository_ctx): # Clone Chrome Depot Tools. git = repository_ctx.which("git") git_command = [git, "clone", "https://chromium.googlesource.com/chromium/tools/depot_tools.git"] repository_ctx.report_progress("Clonin...
## HOMESCAN SHARED FUNCTIONS ## (c) Copyright Si Dunford, Aug 2019 ## Version 1.1.0 # Convert an MQTT return code to an error message def mqtt_errstr( rc ): if rc==0: return "Success" elif rc==1: return "Incorrect protocol version" elif rc==2: return "Invalid client identifier" ...
""" XVM (c) www.modxvm.com 2013-2017 """ # PUBLIC def getAvgStat(key): return _data.get(key, {}) # PRIVATE _data = {}
# File: Average_hight_of_pupils.py # Description: Reading information from the file and finding the average values # Environment: PyCharm and Anaconda environment # # MIT License # Copyright (c) 2018 Valentyn N Sichkar # github.com/sichkar-valentyn # # Reference to: # [1] Valentyn N Sichkar. Reading informatio...
class Solution: def checkIfPangram(self, sentence: str) -> bool: answer = True letters = "abcdefghijklmnopqrstuvwxyz" for letter in letters: if letter not in sentence: answer = False return answer solution = Solution() print(solution.checkI...
class BankOfAJ: loggedinCounter = 0 def __init__(self, theatmpin, theaccountbalance, thename): self.atmpin = theatmpin self.accountbalance = theaccountbalance self.name = thename BankOfAJ.loggedinCounter = BankOfAJ.loggedinCounter + 1 def CollectMoney(self, ammounttowith...
class Solution: def clumsy(self, N: int) -> int: if N==4: return 7 elif N==1: return 1 elif N==2: return 2 elif N==3: return 6 if N%4==0: return (N+1) elif N%4==1: return (N+2) elif N%4==2...
# Author : Nilesh D # December 3 - The Decimation values = input() l = values.split(',') while l != sorted(l): size = len(l) l = l[:size//2] print(l)
def section1(): # Get item from the platform item = dataset.items.get(filepath='/your-image-file-path.jpg') # Create a builder instance builder = item.annotations.builder() # Create ellipse annotation with label - With params for an ellipse; x and y for the center, rx, and ry for the radius and rota...