content
stringlengths
7
1.05M
def show_sequence(n): if n == 0: return '0=0' elif n < 0: return '{}<0'.format(n) return '{} = {}'.format( '+'.join(str(a) for a in xrange(n + 1)), n * (n + 1) // 2 )
class Pool: __slots__ = ('_value', 'max_value', ) def __init__(self, value, max_value=None): self._value = 0 value = int(value) max_value = max_value and int(max_value) self.max_value = max_value or value self.value = value @property def value(self): r...
class ArticleTypeNotAllowed(Exception): def __init__(self): super().__init__("403 The article type is not allowed")
""" You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index that would make this happen, return -1. For example: Let's say you are given the array {1,...
f=open("/home/pirl/darknet/train.txt",'a') for i in range(1,801): #data = 'data/green_light/green_light%d.jpg\n' % i #data = 'data/red_light/ red_light%d.jpg\n' % i #data = 'data/yellow_light/yellow_light%d.jpg\n' % i #data = 'data/60_speed/60_speed%d.jpg\n' % i #data = 'data/30_speed/30_spee...
def aumentar(preço, taxa, formato=False): res = preço + (preço * taxa/100) return res if formato is False else moeda(res) def diminuir(preço, taxa, formato=False): res = preço - (preço * taxa/100) return res if formato is False else moeda(res) def dobro(preço, formato=False): res = preço * 2 ...
# -*- coding: utf-8 -*- class Processador(object): def __init__(self): self.processo_em_execucao = None
USER_LOCK = [] PROCESS_LOCK = [] def user_lock(userid): if userid in USER_LOCK: return False else: USER_LOCK.append(userid) return True def user_unlock(userid): if userid in USER_LOCK: USER_LOCK.remove(userid) def user_check(userid): return userid in USER_LOCK def pr...
#!/usr/bin/env python # Use local host when running locally # port = 'localhost:50051' # Use simple_server_app when running inside docker port = 'simple_server_app:50051' streaming_rate = 0.1
#!/usr/bin/env python def reverse(iterable): """Reverses the iterable. Iterate through the collection with two pointers, one increasing from the beginning of the collection and the other decreasing from the end of the collection, and swap the items at the respective pointers. Iterations through the collect...
# the hardcoded key used in every mozi sample. MOZI_XOR_KEY = b"\x4e\x66\x5a\x8f\x80\xc8\xac\x23\x8d\xac\x47\x06\xd5\x4f\x6f\x7e" # the first 4 bytes of the XOR-ed config. It always begins with [ss]. MOZI_CONFIG_HEADER = b"\x15\x15\x29\xd2" # b"[ss]" ^ XOR_KEY[:4] # the size of the Mozi config string MOZI_CONFIG_TOTA...
#!/usr/bin/python3 # maximizing_xor.py # Author : Rajat Mhetre # follow and drop me a line at @rajat_mhetre def max_xor(l,r): return max(x^y for x in range(l,r+1) for y in range(l,r+1)) if __name__ == '__main__': l = int(input()) r = int(input()) print(max_xor(l,r))
def main(): combined_rect = set() overlapped_rect = set() f = open("input") lines = f.readlines() for line in lines: id_, x, y, size_x, size_y = parse(line) for coord in generate_coord(x, y, size_x, size_y): if coord in combined_rect: overlapped_rect.add(...
class B(object): b:int =1 a:int =1 d:int =1 class C(object): c:int =1 class A(B): a:int = 1 #attr redefined in B b:int = 1 #attr redefined in B # this declaration will be ignore class A(C): a:int = 1 #ok,check attr in C c:int = 1 #attr redefined class D(A): a:int = 1 #at...
""" ARGENTINA: Estos datos son públicos generados, guardados y publicados por organismos de gobierno de la República Argentina. Referencia: http://datos.salud.gob.ar/dataset """ URLS = { 'ar': { 'llamadas_107': 'https://cdn.buenosaires.gob.ar/datosabiertos/datasets/salud/llamados-107-co...
class Solution: # O(n) time | O(n) space def maxProfit(self, prices: List[int]) -> int: n = len(prices) if n <= 1: return 0 diff = [prices[i+1] - prices[i] for i in range(n-1)] dp, dp_max = [0]*(n + 1), [0]*(n + 1) for i in range(n-1): dp[i] = diff[i]...
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def findTarget(self, root, k): """ :type root: TreeNode :type k: int :rtype: bool ...
# Importação de bibliotecas # Título do programa print('\033[1;34;40mSOMA ÍMPARES MÚLTIPLOS DE TRÊS\033[m') # Objetos s = 0 # Lógica for c in range(1, 500, 2): if c % 3 == 0: s = s + c print('A somatória de todos os números ímpares múltiplos de 3 entre 1 e 500 é \033[4;34m{}\033[m'.format(s))
#coding=utf-8 # email smtp_server = "smtp.exmail.qq.com" from_addr = "test@qq.com" mail_username = "test2@qq.com" mail_password = "admin" mail_port = 465 # sms SmsUrl = "" SmsPath = "" AppCode = "" SignName = ""
# # PySNMP MIB module ChrComPmSonetSNT-P-Day-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ChrComPmSonetSNT-P-Day-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:20:38 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version ...
#Class Inheritance #Feline class class Feline: def __init__(self,name): self.name = name print('Creating a feline') def meow(self): print(f'{self.name}: meow') def setName(self, name): print(f'{self} setting name: {name}') self.name = name #Lion class class Li...
#snapshot parameters snapshot_num = 77 galaxy_num = 0 galaxy_num_str = str(galaxy_num) snapnum_str = '{:03d}'.format(snapshot_num) hydro_dir = '/orange/narayanan/desika.narayanan/gizmo_runs/simba/m12_n256_active_boxes/output_m12n256_7/' snapshot_name = 'snapshot_'+snapnum_str+'.hdf5' #where the files should go PD...
''' Projeto: Primeiro e último nome de uma pessoa ''' name = input('Digite seu nome completo: ').strip().split() print('Muito prezer em te conhecer!') print('Seu primeiro nome é {}'.format(name[0])) print('Seu último nome é {}'.format(name[-1]))
class Solution: def combinationSum(self, candidates, target): """ :type candidates: List[int] :type target: int :rtype: List[List[int]] """ ret = [] candidates.sort() def traverse(pos, tmp, left): nonlocal candidates, ret if l...
#!/usr/bin/env python3 ################################################################ # From an imported list, this will sort and return a string # pg 202 ################################################################ def alphalist( orginal_list=[] ): # Create working copy of list passed in sorted_li...
# -*- coding: utf-8 -*- class Numbers: def __init__(self, dct): self.date = dct["date"] self.numbers = dct["balls"] self.stars = dct["stars"] self.draw = dct["draw"] def factory(dct): return Numbers(dct) def __repr__(self): return f"date: {self.date}, draw...
# class Meta(type): # def __new__(mcs, name, bases, namespace): # if name == 'A': # return type.__new__(mcs, name, bases, namespace) # # if 'b_fala' not in namespace: # print(f'Oi, você precisa criar o metodo b_fala em {name}') # else: # if not callable(na...
# MIT License # Copyright (c) 2021 David Rice # 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, pub...
#!/usr/bin/env python3 """ This code is under Apache License 2.0 Written by B_Gameiro (Bernardo Bernardino Gameiro) More in SoloLearn: https://www.sololearn.com/Profile/8198571 GitHub: https://github.com/BGameiro76 Repl.it: https://repl.it/@B_Gameiro Program display help menu GUI in Python 3 Using Tkinter """ #...
# Copyright 2017 mgIT GmbH All rights reserved. # # 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 agre...
#!/usr/bin/env python3 # creates a function add_one() from the lambda x: x + 1 add_one = lambda x: x + 1 print(add_one(2))
__all__ = ["is_private", "Mirror"] def is_private(attribute): """Return whether an attribute is private.""" return attribute.startswith("_") class Mirror: """Class to access attributes via reflection. :param hide_private: do not include private (according to :any:`is_private`) attributes when...
#!/usr/bin/python # SPDX-License-Identifier: MIT with open("input", "r") as file: depths = list(map(int, file)) differences = [j - i for i, j in zip(depths[:-1], depths[1:])] increases = len([i for i in differences if i > 0]) print(f"number of depth increases: {increases}")
s = input() while len(s) > 10: print(s[0:10], end='\n') s = s[10:] if len(s) != 0: print(s) # Reference: https://cleancode-ws.tistory.com/60 """ s = input() for i in range(0, len(s), 10): print(s[i: i+10]) """
"""Escreva um programa que leia a velocidade de um carro. Se ele ultrapassar 80Km/h, mostre uma mensagem dizendo que ele foi multado. A multa vai custar R$7,00 por cada Km acima do limite.""" velocidade = float(input('Qual foi a velocidade do carro em Km/h? ')) if velocidade > 80: print('\033[31mVocê ultrapas...
cavemap_raw = """4323999434356678989012399854245901359876432101298901239876569892012345896567996545678912345689998921 6319898921234589878923987653129892349989949212347892398765498765423456789469884326789923468998997890 5498767892945678967899876543256789998999898943456789987654329878534567994398765434567894579997876789 ...
"""Clean Code in Python - Chapter 3: General Traits of Good Code > Packing / unpacking """ USERS = [(i, f"first_name_{i}", f"last_name_{i}") for i in range(1_000)] class User: """ >>> jsmith = User(1, "John", "Smith") >>> repr(jsmith) "User(1, 'John', 'Smith')" """ def __init__(self, user_i...
load("@debian_package_list//:packages_db.bzl", "PACKAGES_DB") load("@rules_deb//deb/internal:virtual_filesystem.bzl", "write_path_to_label_mapping") load("@rules_deb//deb/internal:packages_parser.bzl", "sanitize_package_name") load("@rules_deb//deb/internal:ldconfig.bzl", "create_shlibs_symlinks") def _remove_extensio...
test_str="Codility we test coders" k=14 for i in range(len(test_str)): if len(test_str)==14: print(test_str) elif len(test_str)<14: print(test_str.strip()) else: test_str1=test_str.split() print(test_str1) lenth=len(test_str1) print(lenth) new_array=[...
""" Write a Python program to print the following floating numbers upto 2 decimal places. """ x = 3.141593 y = 12.99999 print("Original Number: {}".format(x)) print("Formatted Number: {:.2f}".format(x)) print("Original Number: {}".format(y)) print("Formatted Number: {:.2f}".format(y))
# # PySNMP MIB module PDN-DNS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PDN-DNS-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:38:29 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 0...
hexnum = input() number = int(hexnum,16) if(number % 2 == 0): print(0) else: print(1)
# Desenvolva uam lógica que leia o peso e a altura de uma pessoa #calcule seu imc e mostre seu status,de acordo com a tabela abaixo: # - abaixo de 18.5: abaixo do peso # - entre 18.5 e 25: Peso ideal # - 25 até 30: sobrepeso # - 30 até 40: obesidade # - acima de 40: obesidade mórbida peso = float(input('Digite aqui o...
class Solution: def wordPatternMatch(self, pattern: str, str: str) -> bool: table = {} mapped = set() def dfs(pstart, sstart): if pstart == len(pattern): return sstart == len(str) for i in range(sstart, len(str)): if len(str) - i < len(...
"""Rules for running JavaScript programs""" load( "//js/private:js_binary.bzl", _js_binary = "js_binary", _js_binary_lib = "js_binary_lib", _js_test = "js_test", ) load( "//js/private:js_package.bzl", _JsPackageInfo = "JsPackageInfo", _js_package = "js_package", _js_package_lib = "js_pa...
def quick_sort(given_list): if len(given_list) < 1: return given_list else: pivot_element = given_list[0] #here I am choosing the first element to be a pivot left = quick_sort([element for element in given_list[1:] if element < pivot_element]) # moving smaller to left right = qui...
class Solution(object): def isPalindrome(self, s): """ :type s: str :rtype: bool """ target = '' ordA = ord('A') ordZ = ord('Z') orda = ord('a') for c in s: if not c.isalnum(): continue ordC = ord(c) ...
# Copyright (c) 2012 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, }, 'includes': [ 'ui_resources.gypi', ], 'targets': [ { 'target_name': 'ui', 'type...
first = int (input ('First term ')) ratio = int (input ('Ratio ')) tenth = first + (10-1) * ratio for c in range (first, tenth + ratio, ratio): print (c, end = '')
# -*- coding: utf-8 -*- """ shepherd.commons ~~~~~ Defines details of the data exchange protocol between PRU0 and the python code. The various parameters need to be the same on both sides. Refer to the corresponding implementation in `software/firmware/include/commons.h` :copyright: (c) 2019 Networked Embedded System...
# coding: utf-8 """***************************************************************************** * Copyright (C) 2018 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 * re...
#!/usr/bin/python # -*- coding: UTF-8 -*- fo_src = open("src/cv.tex", "r") fo_rev = open("REVISION", "r") fo_print = open("build/cv_print.tex", "w") fo_screen = open("build/cv_screen.tex", "w") try: content = fo_src.read().replace('__REVISION__', fo_rev.read().strip()) fo_print.write(content.replace('__VERSIO...
# https://atcoder.jp/contests/math-and-algorithm/tasks/abc145_d M = 10 ** 6 + 1 MOD = 10 ** 9 + 7 f = [0] * M fi = [0] * M iv = [0] * M f[0] = f[1] = 1 fi[0] = fi[1] = 1 iv[1] = 1 for i in range(2, M): f[i] = f[i - 1] * i % MOD iv[i] = MOD - iv[MOD % i] * (MOD // i) % MOD fi[i] = fi[i - 1] * iv[i] % MOD ...
""" @author: Wenchang Yang (yang.wenchang@uci.edu) """ # ######## data paths on the IRI data library. # surface pr_cmap = 'http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NCEP/.CPC/.Merged_Analysis/.monthly/.latest/.ver2/.prcp_est' cmap = pr_cmap pr_gpcc = 'http://iridl.ldeo.columbia.edu/SOURCES/.WCRP/.GCOS/.GPCC/.FDP/...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = 'check_coverage' __author__ = 'JieYuan' __mtime__ = '19-1-31' """ # from gensim.models import KeyedVectors # # news_path = '../input/embeddings/GoogleNews-vectors-negative300/GoogleNews-vectors-negative300.bin' # embeddings_index = KeyedVectors.load_word2ve...
class Ugly: def isUgly(self, num: int) -> bool: num=int(num) while num: if num==0: return False while num%2 ==0: num=num/2 while num%3 ==0: num=num/3 while num%5==0: ...
class Solution: def peakIndexInMountainArray(self, A: List[int]) -> int: if not A: return None return A.index(max(A))
def _res_statement(items): statements = "" for variable_name, value in items.items(): statements += """ <string name=\\"{}\\">{}</string>""".format(variable_name, value) return statements def _generate_xml(items): statements = """<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?> <resources...
class TreeNode: def __init__(self,key): self.left = None self.right = None self.data = key # Function to insert node in tree recursively def insertNode(root,node): if root is None: root = node else: if root.data < node.data: if root.right is None: ...
# Search in a list def contains(items:[int], x:int) -> bool: i:int = 0 while i < len(items): if items[i] == x: return True i = i + 1 return False if contains([4, 8, 15, 16, 23], 15): print("Item found!") # Prints this else: print("Item not found.")
class ChannelRaid: """Classe definissant le contenu en cours des channels de raid: - NB_CHANNEL: nombre de channel construites par le bot - id: numero du cannal - raid: descripsion du raid en cours, si raid = 0 alors c'est vide - com: l'objet discord.channel qui permet de communiquer simplement avec...
def standardize_money(value, unit): std_unit = '元' lookup_table = {'元':1, '块钱':1, '角':1e-1, '分':1e-2} std_value = value * lookup_table[unit] return {'std_value':std_value, 'std_unit':std_unit} def standardize_weight(value, unit): std_unit = '克' lookup_table = {'毫克':1e-3, '克':1, '千克':1e3, 'kg':1...
__all__ = () class ConnectionKey: """ Contains information about a host, like proxy, TLS to prevent reusing wrong connections from the pool. Attributes ---------- host : `str` The host's ip address. is_ssl : `bool` Whether the connection is secure. port : `int` ...
__title__ = 'sec-edgar-financials' __description__ = 'Extract financial data from the SEC EDGAR database' __url__ = 'https://github.com/farhadab/sec-edgar-financials' __version__ = '0.0.1' __author__ = 'Farhad Abdolhosseini' __author_email__ = 'farhadab15@gmail.com' __license__ = 'MIT' # __copyright__ = 'Copyright 2019...
"""Reusable static data.""" COMMIT = """ <lock-configuration/> <commit/> <unlock-configuration/> """ COMMIT_CHECK = """ <commit-configuration> <check/> </commit-configuration> """ CONFIG_JSON = """ <lock-configuration/> <load-configuration format="json"> <configuration-json> {config} </configurat...
""" Calculates the normal distribution's probability density function (PDF). Calculates Standard normal pdf for mean=0, std_dev=1. Equation: f(x) = 1 / sqrt(2*pi) * e^(-(x-mean)^2/ 2*std_dev^2) """ def pdf(x, mean=0, std_dev=1): PI = 3.141592653589793 E = 2.718281828459045 term1...
# -*- coding: utf-8 -*- { '\n\nThank you!': '\n\nThank you!', '\n\nWe will wait and let you know when your payment is confirmed.': '\n\nWe will wait and let you know when your payment is confirmed.', '\n- %s from %s to %s': '\n- %s from %s to %s', '\nAmount: R$%.2f': '\nAmount: R$%.2f', "\nSomething happened and we cou...
def binary_search(a,x): first_pos=0 last_pos=len(a)-1 flag=0 count=0 while(first_pos<=last_pos and flag==0): count=count+1 mid=(first_pos+last_pos)//2 if(x==a[mid]): flag==1 print("The element is present at position:",str(mid)) p...
# # PySNMP MIB module Juniper-REDUNDANCY-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-REDUNDANCY-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:53:26 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (d...
# -*- coding: utf-8 -*- # AtCoder Beginner Contest if __name__ == '__main__': n = int(input()) if n == 100: print('Perfect') elif 90 <= n <= 99: print('Great') elif 60 <= n <= 89: print('Good') else: print('Bad')
n = int(input('DIGITE UM NÚMERO INTEIRO ')) suc = n+1 ant = n-1 print ('O SUCESSOR É {}\nE O ANTECESSOR É {}'.format(suc,ant))
# -*- coding: utf-8 -*- """ collection This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). """ class StatusEnum(object): """Implementation of the 'Status' enum. TODO: type enum description here. Attributes: PENDING: TODO: type description here...
""" The complete list of SCF level wavefunction quantities. """ scf_wavefunction = {} # Orbitals scf_wavefunction["scf_orbitals_a"] = { "type": "array", "description": "SCF alpha-spin orbitals in the AO basis.", "items": {"type": "number"}, "shape": {"nao", "nmo"} } scf_wavefunction["scf_orbitals_b"...
# coding=utf-8 """Utility functions""" class Utils(object): """Utility functions""" @staticmethod def combine_dicts(dict_1, dict_2): """Creates a new dictionary which is the union of two dictionaries with a shallow copy of the elements""" combined = {} for key, value in (...
MCTS_CONFIG = { "c_puct": 5.0, "c_iterations": 400, } DATA_CONFIG = { # one of "random", "botzone", "mcts", "alpha_zero" "schedule": { "supervisor": ("traditional_mcts", { "c_puct": MCTS_CONFIG["c_puct"], "c_iterations": 20000 }), "candidates": [ ...
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # 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 ap...
# https://www.interviewbit.com/problems/mathbug01/ # MATH_BUG01 class Solution: # @param A : integer # @return an integer def isPrime(self,A): upperLimit = int(A**0.5) for i in range(2, upperLimit + 1): if i < A and A % i == 0: return 0 return 1
n=7 mid=(n+1)/2 for i in range(1,n+1): for j in range(1,n+1): condition= i + j>=mid + 1 and i + j<=mid + n and i-j<=mid-1 and j-i<=mid-1 and j<=mid if condition: print("0",end="") else: print(" ",end="") print()
# Calculadora em Python # Desenvolva uma calculadora em Python com tudo que você aprendeu nos capítulos 2 e 3. # A solução será apresentada no próximo capítulo! # Assista o vídeo com a execução do programa! print("\n******************* Python Calculator *******************") print("\nObserve as operações matemática...
_base_ = [ '../../_base_/models/vgg19bn.py', './dataset.py', './schedule.py', './default_runtime.py', ] model = dict( backbone=dict( num_classes=20, ) )
print('\033[1;32mBANCO DE DADOS\033[m') lista = list() dados = list() quantidade = maior_peso = menor_peso = 0 while True: print('-=' * 30) dados.append(str(input('Digite o nome: '))) dados.append(float(input('Digite o peso: '))) if len(lista) == 0: maior_peso = menor_peso = dados[1] else: ...
def load(h): return ({'abbr': 0, 'code': 0, 'title': 'Wave spectra (1)', 'units': '-'}, {'abbr': 1, 'code': 1, 'title': 'Wave spectra (2)', 'units': '-'}, {'abbr': 2, 'code': 2, 'title': 'Wave spectra (3)', 'units': '-'}, {'abbr': 3, 'code': 3, 'title': ...
#SOLUTION FOR P32 '''P32 (**) Determine the greatest common divisor of two positive integer numbers. Use Euclid's algorithm. Example: * (gcd 36 63) 9''' num1 = int(input('enter first number = ')) num2 = int(input('enter second number = ')) #CREATE A FUNCTION TO CALCULATE GCD def find_gcd(n1,n2): while n2!=0: ...
# enumerate # Funções equivalentes lista = ['Maçã', 'Abacate', 'Pera', 'Uva', 'Morango'] for i in range(len(lista)): print(i, lista[i]) for idx, nome in enumerate(lista): print(idx, nome)
class Type: def __init__(self, name, members: list = None): self.name = name self.members = members or ['*']
def calculation(command, b, c): calculations = { 'multiply': b * c, 'divide': b / c, 'add': b + c, 'subtract': b - c, } return calculations[command] operator = input() parameter_one = int(input()) parameter_two = int(input()) print(calculation(operator, param...
# -*- coding: utf-8 -*- __version__ = '1.1.0' default_app_config = 'aldryn_search.apps.AldrynSearchConfig'
print ("Salve...Dovrebbe inserire il suo reddito per avviare lo script-calcolo delle aliquota 2015/2016") reddito = float (input ("Digiti di seguito il suo reddito: ")) if reddito < 20000 and reddito > 0 : aliquota2 = 2/100 print ("L'aliquota è del",aliquota2,"%") tassa1 = (reddito * aliquota2) print ("La...
""" File: largest_digit.py Name: Rebecca ---------------------------------- This file recursively prints the biggest digit in 5 different integers, 12345, 281, 6, -111, -9453 If your implementation is correct, you should see 5, 8, 6, 1, 9 on Console. """ def main(): print(find_largest_digit(12345)) # 5 print(f...
class Node: pass class Void(Node): def __init__(self): self.computedType = 'Void' class ProgramNode(Node): def __init__(self, classList): self.classList = classList class ExpressionNode(Node): pass class Arithmetic(ExpressionNode): def __init__(self, left, right): self.lef...
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") _RCLONE_VERSION="v1.50.0" def _add_rclone_build(platform, architecture, sha256=None): rule_name = "rclone_{platform}_{arch}".format(platform=platform, arch=architecture) if not native.existing_rule(rule_name): package_name = "rclone-{version...
# 141, Суптеля Владислав # 【Дата】:「09.03.20」 # 7. Написати рекурсивну функцію, що визначає, чи є симетричною частина рядка S, починаючи з i-го елемента і закінчуючи j-м. def simline(S, i, j): if (i == j or j-1 == i): # парное или непарное кол-во элементов return 1 ...
reddit = dict( client_id="", client_secret="", username="", password="", user_agent="Daltonism Helper Bot (created by /u/OffDutyHuman)") imgur = dict( client_id="", client_secret="", access_token="", refresh_token="")
# -*- coding: utf-8 -*- """ Created on Wed Aug 10 14:55:16 2016 @author: Stuart """ version = "0.8.0"
class Solution(object): def isPalindrome(self, s): """ :type s: str :rtype: bool """ s = ''.join(ch.lower() for ch in s if ch.isalnum()) half = len(s) // 2 return not half or s[:half] == s[-half:][::-1]
"""Madoop Exception Types. Andrew DeOrio <awdeorio@umich.edu> """ class MadoopError(Exception): """Top level exception raised by Madoop functions."""
class TestConfig: def test_config(self, config): pass
COLOR_PALETTES = { "lisk": { "bg0": "#FEF1E2", "bg1": "#FEDBAB", "bg2": "#FEC478", "fg0": "#FE9923", "fg1": "#FE8821", "fg2": "#E5741A", "text0": "#827F85", "text1": "#57555C", "text2": "#3C3A41", "accent0": "#21D8FF", "accent1"...
""" OneGov uses a very simple permissions model by default. There are no read/write permissions, just intents. That means a permission shows the intended audience. This is the default however, any application building on top of onegov.core may of course introduce its own byzantine permission system. """ class Publi...
# author: Zhongyuan Sun # Storing the loop numbers will help improving performance from 0.63% to 93.93% class Solution(object): def isHappy(self, n): """ :type n: int :rtype: bool """ if n <= 0: return False x = self.cal(n) # loop_numbers = self....