content
stringlengths
7
1.05M
# -*- coding: utf-8 -*- """ Top-level package for {{ cookiecutter.municipality }} CDP instance backend. """ __author__ = "{{ cookiecutter.maintainer_full_name }}" __version__ = "1.0.0" def get_module_version() -> str: return __version__
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@berty_go//:repositories.bzl", "berty_go_repositories") def berty_bridge_repositories(): # utils maybe(...
LOCATION_TERMS = ['city', 'sub_region', 'region', 'country'] def get_geographical_granularity(data): """Returns the index of the lowest granularity level available in data.""" for index, term in enumerate(LOCATION_TERMS): if term in data.columns: return index def check_column_and_get_ind...
def score(name=tom,score=0): print(name," scored ", score )
# estos es un cometario en python #decalro una variable x = 5 # imprime variable print ("x =",x) #operaciones aritmeticas print ("x - 5 = ",x - 5) print ("x + 5 = ",x + 5) print ("x * 5 = ",x * 5) print ("x % 5 = ",x % 5) print ("x / 5 = ",x /5) print ("x // 5 = ",x //5) print ("x ** 5 = ",x **5)
class PushwooshException(Exception): pass class PushwooshCommandException(PushwooshException): pass class PushwooshNotificationException(PushwooshException): pass class PushwooshFilterException(PushwooshException): pass class PushwooshFilterInvalidOperatorException(PushwooshFilterException): ...
""" The deal with super is that you can easily call a function of a parent or a sister class that you have inherited, without necessarily calling the classes then their functions an example """ class Parent: def __init__(self, i): print(i) class Sister: def __init__(self): print("asda") cla...
# # PySNMP MIB module CISCO-ENTITY-SENSOR-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ENTITY-SENSOR-CAPABILITY # Produced by pysmi-0.3.4 at Mon Apr 29 17:39:53 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python ...
""" Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all equal. Example 1: Input: nums = [4, 3, 2, 3, 5, 2, 1], k = 4 Output: True Explanation: It's possible to divide it into 4 subsets (5), (1, 4), (2,3), (2,3) with e...
# -*- coding: utf-8 -*- __author__ = 'Alfredo Cobo' __email__ = 'ajscobo@gmail.com' __version__ = '0.1.0'
in_file = 'report_suis.tsv' biovar_list = ['bv01', 'bv02', 'bv03', 'bv04', 'bv05'] for biovar in biovar_list: if biovar == 'bv04': t=1 bv = biovar[-1] preID = 0 pos = 0 pcrID = 0 anyID = 0 justPCR = 0 false_pos = 0 false_neg = 0 with open(in_file, 'r') as f: for...
# 18. Write a Python program to calculate the sum of three given numbers, if the values are equal then return three times of their sum. # Question: # Input: # Output: # Solution: https://www.w3resource.com/python-exercises/python-basic-exercise-18.php # Ideas: """ 1. """ # Steps: """ """ # Notes: """ """ # C...
# Create a class called Triangle with 3 instances variables that represents 3 angles of triangle. Its __init__() method should take self, angle1, angle2, and angle3 as # arguments. Make sure to set these appropriately in the body of the __init__() method. Create a method named check_angles(self). It should return True ...
class Cat: __mew: str = 'муурр'*4 def make_happy(self) -> str: return self.__mew kuzya = Cat() print(kuzya.__mew) # Не сработает # print(kuzya.mew) print(kuzya.make_happy())
fields_masks = { 'background': "sheets/data/rowData/values/effectiveFormat/backgroundColor", 'value': "sheets/data/rowData/values/formattedValue", 'note': "sheets/data/rowData/values/note", 'font_color': "sheets/data/rowData/values/effectiveFormat/textFormat/foregroundColor" }
def tuple_to_string(tuple): string = '' for i in range(0, len(tuple)): num = tuple[i] char = chr(num) string += str(char) return string
""" Find a quote from a famous person you admire. Print the quote and the name of its author. """ quote = 'Those who dream by day are cognizant of many things which escape those who dream only by night' name = 'edgar allan poe' print(f'{name.title()} once said, "{quote}".') quote = 'Don’t compare yourself with anyone...
# -*- coding: utf-8 -*- """ resultsExport.py A small command-line tool to calculate mileage statistics for a personally-owned vehicle. Handles results export to Python objects, ready for use in a Jinja HTML template. """
# formatting colors reset = "\033[0m" red = "\033[0;31m" green = "\033[0;32m" yellow = "\033[0;33m" blue = "\033[0;34m" purple = "\033[0;35m" BRed = "\033[1;31m" BYellow = "\033[1;33m" BBlue = "\033[1;34m" BPurple = "\033[1;35m" On_Black = "\033[40m" BIRed = "\033[1;91m" BIYellow = "\033[1;93m" BIBlue = "...
def count(sequence, item): amount = 0 for x in sequence: if x == item: amount += 1 return amount
# https://atcoder.jp/contests/atc001/tasks/unionfind_a N,Q = map(int,input().split()) par = [i for i in range(N+1)] def find(x): if par[x] == x: return x else: par[x] = find(par[x]) #経路圧縮 return par[x] def same(x,y): return find(x) == find(y) def unite(x,y): x = find(x) y...
''' Write a Python program to get the sum of a non-negative integer. ''' class Solution: def __init__(self, num): self.num = num def sum_digits(self, x): if x == 1: return int(str(self.num)[-1]) else: return int(str(self.num)[-x]) + self.sum_digits(x-1) def s...
'#La nomenclatura utilizada es INSTANCIA_ESQUEMA_PWD' FISCO_USER = 'FISCAR' FISCO_FISCAR_PWD = 'FISCAR' '#String de conexion ' FISCO_CONNECTION_STRING = '10.30.205.127/fisco'
def hamming_distance(string1, string2): assert len(string1) == len(string2) distance = 0 for i in range(len(string1)): if string1[i] != string2[i]: distance += 1 return distance '''def results(string1, string2): print(hamming_distance(string1, string2)) results('CGTGAGATAGCATATGGTAAATGTTCCGCAATCGCTACCGCC...
# -*- coding: utf-8 -*- __author__ = 'Hamish Downer' __email__ = 'hamish@aptivate.org' __version__ = '0.1.0'
class SparkPostException(Exception): pass class SparkPostAPIException(SparkPostException): "Handle 4xx and 5xx errors from the SparkPost API" def __init__(self, response, *args, **kwargs): # noinspection PyBroadException try: errors = response.json()['errors'] error...
{ "targets": [ { "target_name": "switch_bindings", "sources": [ "src/switch_bindings.cpp", "src/log-utils/logging.c", "src/log-utils/log_core.c", "src/common-utils/common_utils.c", "src/shm_core/shm_dup.c", "src/shm_core/shm_data.c", "src/shm_core/shm_mutex.c...
def main(): n = int(input()) for a in range(1, 10): b = n / a if 1 <= b and b <= 9 and b % 1 == 0: print('Yes') exit() print('No') if __name__ == '__main__': main()
""" Você deve criar uma classe carro que vai possuir dois atributos compostos por outras duas classes. Motor Direção O motor terá a responsabilidade de controlar a velocidade. Ele oferece os seguintes atributos: 1 - Atributo de dado Velocidade. 2 - Método acelerar que deverá incrementar a velocidade de uma unidade...
x = int(input("Enter number")) for i in range(x): a = list(str(i)) sum1 = 0 for j in range(len(a)): b = int(a[j])**len(a) sum1 = sum1 + b if i == sum1: print (i,"amstrong")
x = int(input("Please enter the first digit")) y = int(input("Please enter the second digit")) output_list = [] while len(output_list) < x - 1: for i in range(0, x): list_2d = [] output_list.append(list_2d) for j in range(0 ,y): number = i * j output_list[i].append...
# -*- Python -*- # Copyright 2021 The Verible Authors. # # 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 la...
class Player(): def __init__(self, name): self.name = name self.force = 0.0 def set_force(self, force): self.force = force
def combine_nonblank_lines(content: list[str], sep: str = " ") -> list[str]: content = [item.strip() for item in content] i, new_content, clean_content = 0, "", [] while i < len(content): if content[i] == "": clean_content.append(new_content.strip()) new_content = "" ...
# -*- coding: utf-8 -*- """ Created on Wed Jan 3 07:32:06 2018 @author: James Jiang """ all_lines = [line.rstrip('\n') for line in open('Data.txt')] all_triples = [line.split('x') for line in all_lines] all_triples_int = [] for triple in all_triples: all_triples_int.append([int(num) for num in triple]) total = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 25 14:05:46 2020 @author: jwiesner """
def phoneCall(min1, min2_10, min11, s): minutes = 0 rate = min1 while s > 0: minutes += 1 if minutes == 2: rate = min2_10 elif minutes > 10: rate = min11 s -= rate if s < 0: minutes -= 1 return minutes
print('hello\tworld') print('hello\nworld') print( len('hello world')) print('hello world'[0]) my_letter_list = ['a','a','b','b','c'] print(my_letter_list) print( set(my_letter_list)) my_unique_letters = set(my_letter_list) print(my_unique_letters) print( len(my_unique_letters)) print( 'd' in my_unique_letters...
# -*- coding: utf-8 -*- def get_height_magnet(self): """get the height of the hole magnets Parameters ---------- self : HoleM53 A HoleM53 object Returns ------- Hmag: float height of the 2 Magnets [m] """ # magnet_0 and magnet_1 have the same height Hmag = s...
"""Message type identifiers for Trust Pings.""" SPEC_URI = ( "https://github.com/hyperledger/aries-rfcs/tree/" "527849ec3aa2a8fd47a7bb6c57f918ff8bcb5e8c/features/0048-trust-ping" ) PROTOCOL_URI = "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/trust_ping/1.0" PING = f"{PROTOCOL_URI}/ping" PING_RESPONSE = f"{PROTOCOL_URI...
""" Constants used by the packageinstaller module Copyright (C) 2017-2022 Intel Corporation SPDX-License-Identifier: Apache-2.0 """ # Configuration command/response channel REMEDIATION_CONTAINER_CMD_CHANNEL = 'remediation/container' REMEDIATION_IMAGE_CMD_CHANNEL = 'remediation/image' EVENTS_CHANNEL = ...
# The value to indicate NO LIMIT parameter NO_LIMIT = -1 # PER_CPU_SHARES has been set to 1024 because CPU shares' quota # is commonly used in cloud frameworks like Kubernetes[1], # AWS[2] and Mesos[3] in a similar way. They spawn containers with # --cpu-shares option values scaled by PER_CPU_SHARES. PER_CPU_SHARES =...
n = int(input()) total = 0 line = map(int, input().split()) for _ in line: if _ < 0: total += -_ print(total)
# !/usr/bin/env python # -*- coding: utf-8 -*- # ====================================================================================================================== # The MIT License (MIT) # ====================================================================================================================== # Copyr...
#common variables! def set_loop(lp): global loop #not to use local variable loop=lp def set_nm(nm): global noisymode noisymode=nm def get_loop(): return loop def get_nm(): return noisymode loop=[] noisymode=False
def maior(): for c in range(10): num = int(input()) if c == 0: maior = primeiro = num if num > maior: maior = num print(maior) if maior % primeiro == 0: print(primeiro) maior()
# coding: utf-8 # 2021/3/17 @ tongshiwei def etl(*args, **kwargs) -> ...: # pragma: no cover """ extract - transform - load """ pass def train(*args, **kwargs) -> ...: # pragma: no cover pass def evaluate(*args, **kwargs) -> ...: # pragma: no cover pass class CDM(object): def __in...
AwayPlayerFoulClockStart=0 AwayLastPlayerFoul='' HomePlayerFoulClockStart=0 HomeLastPlayerFoul=''
# -*- coding: utf-8 -*- # Copyright (c) 2008-2016 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """Functions to generate files readab...
class Solution: def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ if not s: return 0 length = 0 current = "" i = 0 j = 0 while i < len(s) and j < len(s): if s[j] in curren...
#Global PARENT_DIR = "PARENT_DIR" #Logging LOG_FILE = "LOG_FILE" SAVE_DIR = "SAVE_DIR" TENSORBOARD_LOG_DIR = "TENSORBOARD_LOG_DIR" #Preprocessing Dataset DATASET_PATH = "DATASET_PATH" #DeepSense Parameters ##Dataset Parameters BATCH_SIZE = "BATCH_SIZE" HISTORY_LENGTH = "HISTORY_LENGTH" HORIZON = "HORIZON" MEMORY_SIZ...
# https://www.codechef.com/problems/TWOSTR for T in range(int(input())): a,b,s=input(),input(),0 for i in range(len(a)): if(a[i]==b[i] or a[i]=="?" or b[i]=="?"): s+=1 print("Yes") if(s==len(a)) else print("No")
w2vSize = 100 feature_dim = 100 max_len=21 debug = False poolSize=32 topicNum = 100 fresh = True
# Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next """ class Solution: def getlen(self,node): count = 0 while node is not None: count+=1 node = node.next return count def g...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 定义一个类 1. 用 __name 表示一个私有成员变量,外部不可直接访问 2. __init__ 表示类初始化函数,当创建一个对象的时候,需要调用此方法 """ class Person(object): def __init__(self, name: str, age: int) -> None: self.__name = name self.__age = age def print(self): print('name=%s, age=%s' %...
E = [[ 0, 1, 0, 0, 0, 0], [E21, 0, 0, E24, E25, 0], [ 0, 0, 0, 1, 0, 0], [ 0, 0, E43, 0, 0, -1], [ 0, 0, 0, 0, 0, 1], [E61, 0, 0, E64, E65, 0]]
class ComponentMeta(type): """Metaclass that builds a Component class. This class transforms the _properties class property into a __slots__ property on the class before it is created, which suppresses the normal creation of the __dict__ property and the memory overhead that brings. """ def __n...
"""Utility functions for processing connection tables and related data.""" def clean_atom(atom_line): """Removes reaction-specific properties (e.g. atom-atom mapping) from the atom_line and returns the updated line.""" return atom_line[:60] + ' 0 0 0' def clean_bond(bond_line): """Removes r...
#Represents the entire memory bank of the TB-3 (64 patterns in total) class TB3Bank: BANK_SIZE = 64 def __init__(self,patterns=None): if(patterns != None): self.patterns = patterns else: self.patterns = [] def get_patterns(self): return self.patterns def get_pattern(self,index): return self.patt...
# 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, software # distributed under the Li...
# Time: O(nlogn) # Space: O(n) class Solution(object): def intersectionSizeTwo(self, intervals): """ :type intervals: List[List[int]] :rtype: int """ intervals.sort(key = lambda s_e: (s_e[0], -s_e[1])) cnts = [2] * len(intervals) result = 0 while int...
#!/usr/bin/env python ####################################### # Installation module for mana-toolkit ####################################### # AUTHOR OF MODULE NAME AUTHOR="jklaz" # DESCRIPTION OF THE MODULE DESCRIPTION="This module will install/update the mana-toolkit" # INSTALL TYPE GIT, SVN, FILE DOWNLOAD # OPTIO...
class Holding_Registers: Winch_ID, \ DIP_Switch_Status, \ Soft_Reset, \ Max_Velocity, \ Max_Acceleration, \ Encoder_Radius, \ Target_Setpoint, \ Target_Setpoint_Offset, \ Kp_velocity, \ Ki_velocity, \ Kd_velocity, \ Max_Encoder_Feedrate, \ Kp_position, \ Ki_position, \ Kd_position, \ Kp, \ Ki, \ Kd, \...
first_term = int(input('Insert the first term of an arithmetic progression: ')) reason = int(input('Insert the reason of the arithmetic progression: ')) for c in range (1, 11): if reason == 0: print(first_term) elif reason > 0: c = first_term + (c - 1)*reason print(c) else: c...
self = [1]*11000 for i in range(1,10): self[2*i-1] = 0 for j in range(10,100): self[j+int(str(j)[0])+int(str(j)[1])-1] = 0 for k in range(100,1000): self[k+int(str(k)[0])+int(str(k)[1])+int(str(k)[2])-1] = 0 for m in range(1000,10000): self[m+int(str(m)[0])+int(str(m)[1])+int(str(m)[2])+int(str(m)[3])...
APP_KEY = 'your APP_KEY' APP_SECRET = 'your APP_SECRET' OAUTH_TOKEN = 'your OAUTH_TOKEN' OAUTH_TOKEN_SECRET = 'your OAUTH_TOKEN_SECRET' ROUTE = 'your ROUTE'
__about__ = """Merge Sorted Linked List only single traverse allowed.""" class Node: def __init__(self,value): self.data = value self.next = None class LinkedList: def __init__(self): self.head = None self.current = None def push(self,value): push_node = Node(value...
def main(): s = input("Please enter your sentence: ") words = s.split() wordCount = len(words) print ("Your word and letter counts are:", wordCount) main()
""" Model-Based Configuration ========================= This app allows other apps to easily define a configuration model that can be hooked into the admin site to allow configuration management with auditing. Installation ------------ Add ``config_models`` to your ``INSTALLED_APPS`` list. Usage ----- Create a sub...
""" Programa 013 Área de estudos. data 16.11.2020 (Indefinida) Hs @Autor: Abraão A. Silva """ # Coleta do dia e peso pescado. dia = int(input('Dia da pesca.: ')) peso = float(input('Quantidade de pescados(kg).: ')) # O "excesso" tem o valor da quantidade pescada, menos o peso maximo permitido. excesso = (peso - 5...
#!/usr/bin/env python3 def calculate(): L = 100000 rads = [0] + [1] * L for i in range(2, len(rads)): if rads[i] == 1: for j in range(i, len(rads), i): rads[j] *= i data = sorted((rad, i) for(i, rad) in enumerate(rads)) return str(data[10000][1]) if __name__ =...
temperatures = [] with open('lab_05.txt') as infile: for row in infile: temperatures.append(float(row.strip())) min_tem = min(temperatures) max_tem = max(temperatures) avr_tem = sum(temperatures)/len(temperatures) temperatures.sort() median = temperatures[len(temperatures)//2] unique = len(set(temperature...
class KeyGesture(InputGesture): """ Defines a keyboard combination that can be used to invoke a command. KeyGesture(key: Key) KeyGesture(key: Key,modifiers: ModifierKeys) KeyGesture(key: Key,modifiers: ModifierKeys,displayString: str) """ def GetDisplayStringForCulture(self,culture): """ GetD...
s = 0 for c in range(0, 4): n = int(input('Digite um numero:')) s += n print('O somatorio de todos os valores foi {}'.format(s))
def dict_to_str(src_dict): dst_str = "" for key in src_dict.keys(): dst_str += " %s: %.4f " %(key, src_dict[key]) return dst_str class Storage(dict): """ A Storage object is like a dictionary except `obj.foo` can be used inadition to `obj['foo']` ref: https://blog.csdn.net/a20082214608...
# string di python bisa menggunakan # petik satu dan petik dua # contoh # "Hello World" sama dengan 'hello world' # 'hello world' sama dengan "hello world" kata_pertama = "warung" # bisa juga menggunakan multi string # bisa menggunakan 3 tanda petik dua atau satu kata_saya = """indonesia adalah negara yang indah ber...
faces = fetch_olivetti_faces() # set up the figure fig = plt.figure(figsize=(6, 6)) # figure size in inches fig.subplots_adjust(left=0, right=1, bottom=0, top=1, hspace=0.05, wspace=0.05) # plot the faces: for i in range(64): ax = fig.add_subplot(8, 8, i + 1, xticks=[], yticks=[]) ax.imshow(faces.images[i], ...
class Solution: def findLucky(self, arr: List[int]) -> int: x=[i for i in arr if arr.count(i)==i] if not x: return -1 else: return max(x)
VERSION = (0, 2, 1) """Application version number tuple.""" VERSION_STR = '.'.join(map(str, VERSION)) """Application version number string.""" default_app_config = 'sitetables.apps.SitetablesConfig'
i = input("Enter a number: ") d = '0369' if i[-1] in d: print('Last digit is divisible by 3.') else: print('Last digit is not divisible by 3.')
""" Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is defined as a character sequence consists of non-space characters only. Example: Given s = "Hello World", return 5 as l...
# Get the config object c = get_config() # Inline figures when using Matplotlib c.IPKernelApp.pylab = 'inline' c.NotebookApp.ip = '*' c.NotebookApp.allow_remote_access = True # Do not open a browser window by default when using notebooks c.NotebookApp.open_browser = False # INSECURE: No token. Always use jupyter over s...
Import('env') global_env = DefaultEnvironment() global_env.Append( CPPDEFINES=[ "MSGPACK_ENDIAN_LITTLE_BYTE", ] )
def get_label_lower(opts): if hasattr(opts, 'label_lower'): return opts.label_lower model_label = opts.model_name app_label = opts.app_label return "{app_label}.{model_label}".format(app_label=app_label, model_label=model_label)
# list the uses of all certificates res = client.get_certificates_uses() print(res) if type(res) == pypureclient.responses.ValidResponse: print(list(res.items)) # list the uses of certificates named "ad-cert-1" and "posix-cert" res = client.get_certificates_uses(names=['ad-cert-1', 'posix-cert']) print(res) if type...
def allLongestStrings(inputArray): ''' Given an array of strings, return another array containing all of its longest strings. ''' resultArray = [] currentMax = len(inputArray[0]) for i in range(len(inputArray) ): currentLen = len(inputArray[i]) if currentLen...
n , m = map(int, input().split()) array = list(map(int, input().split())) A = list(set(map(int, input().split()))) B = list(set(map(int, input().split()))) happiness = 0 for i in range(n): for j in range(m): if array[i] == A[j]: happiness += 1 elif array[i]...
def relativeSorting(A1,A2): common_elements = set(A1).intersection(set(A2)) extra = set(A1).difference(set(A2)) out = [] for i in A2: s = [i] * A1.count(i) out.extend(s) extra_out = [] for j in extra: u = [j] * A1.count(j) extra_out.extend(u) out = out + sorte...
#!/usr/bin/env python3.8 # Copyright 2021 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. def f(): print('lib.f') def truthy(): return True def falsy(): return False
n=int(input()) a=list(map(int,input().split())) jump=0 i=0 while i<=n: if i+2<n and a[i+2]==0: jump+=1 i+=2 elif i+1<n and a[i+1]==0: jump+=1 i+=1 else: i+=1 print(jump)
""" AvaTax Software Development Kit for Python. Copyright 2019 Avalara, Inc. 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 Unles...
class config(object): rank_norm = 0 run_list = str.split("zh2en_w2vv_attention w2vv_attention") nr_of_runs = len(run_list) #weights = [1.0/nr_of_runs] * nr_of_runs weights = [0.73, 0.27]
# pylint: disable=line-too-long # SPDX-FileCopyrightText: Copyright (c) 2021 ajs256 # # SPDX-License-Identifier: MIT """ `seriallcd` ================================================================================ CircuitPython helper library for Parallax's serial LCDs * Author(s): ajs256 Implementation Notes -----...
def duplicate_number(arr): """ :param - array containing numbers in the range [0, len(arr) - 2] return - the number that is duplicate in the arr """ current_sum = 0 expected_sum = 0 for num in arr: current_sum += num for i in range(len(arr) - 1): expected_su...
Produto = input('Produto: ') Preco=float(input("Preço do produto em R$: ".format(Produto))) Desconto = float(input("Desconto [%]: ")) desc = (Preco * Desconto)/100 PrecoDesconto = Preco - desc print('A {} com desconto de {}% saira por {:.2f}R$'.format(Produto, Desconto, PrecoDesconto)) #Gabarito print("com desconto ...
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ print('欢迎来到恋爱大冒险') input() print('请按回车键来进行游戏') input() print('经过三年的学习,我终于和同年级的暗恋的女生考上了同一所大学') input() print('开学第一天,我在食堂遇到她了,我应该') input() print('1.直接上去要微信\t2.以老乡的名义上去聊天\t3.继续吃饭') option1=int(input('请做出选择:按数字1-3,然后回车\n')...
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( n ) : if ( n == 0 ) : return "0" ; bin = "" ; while ( n > 0 ) : if ( n & 1 == 0 ) : ...
class Clip: def __init__(self, start_time: float, end_time: float): self.start_time: float = start_time self.end_time: float = end_time @property def length_in_seconds(self) -> float: return self.end_time - self.start_time
# LISTAS INTERNAS - ISINSTANCE minhaLista = [[1, "a", 2], [3, 4, "b"], ["c", 5, "d"]] letras = [] numeros = [] for listaInterna in minhaLista: for elementos in listaInterna: if (isinstance(elementos, str)): letras.append(elementos) else: numeros.append(elemento...
slackInfo = { "url": "https://hooks.slack.com/services/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", "username": "leaderboard-bot", } hackerrankInfo = { "url": "https://www.hackerrank.com/rest/contests/wissen-coding-challenge-2021/leaderboard", }