content
stringlengths
7
1.05M
def gcd(a,b): return gcd(b,a%b) if b else a def lcm3(a,b,c): return a*b*c*gcd(gcd(a,b),c)//gcd(a,b)//gcd(b,c)//gcd(a,c) x=[*map(int,input().split())] r=100**5 for i in range(5): for j in range(i+1,5): for k in range(j+1,5): n=lcm3(x[i],x[j],x[k]) r=min(n,r) print(r)
for _ in range(int(input())): v,e=input().split() v=float(v) if e=="kg":print("%.4f"%(v*2.2046),"lb") if e=="lb":print("%.4f"%(v*0.4536),"kg") if e=="l":print("%.4f"%(v*0.2642),"g") if e=="g":print("%.4f"%(v*3.7854),"l")
coordinates_E0E1E1 = ((126, 108), (127, 80), (127, 81), (127, 100), (127, 108), (127, 120), (128, 78), (128, 79), (128, 81), (128, 89), (128, 99), (128, 100), (128, 108), (128, 109), (128, 120), (129, 75), (129, 81), (129, 87), (129, 89), (129, 98), (129, 101), (129, 108), (129, 109), (129, 120), (130, 75), (130, 77)...
print("Menue:") print("1: Heizstab ein") print("2: Heizstab aus") print("3: Programm beenden") # aktion = 0 while aktion != 3: aktion = int(input("Aktion wählen:")) # Funktion ausführen if aktion == 1: print("Heizstab wird eingeschaltet") elif aktion == 2: print("Heizstab wird ausgesc...
P4_PLUGIN = 'q-p4-plugin' P4_AGENT = 'q-p4-agent' P4MODULE = 'p4-module' CONFIGURATION = 'p4-config'
# -*- coding: utf-8 -*- """ Big Bucket o' Exceptions """ class PacketException(ValueError): """There was an error encoding or decoding your packet.""" class ChannelException(ValueError): """Channel woes"""
def isPalindrome(s): return s == ''.join(list(reversed(s))) nums = sorted([x*y for x in range(1000) for y in range(x+1)], reverse=True) for x in nums: if isPalindrome(str(x)): print(x) break
vendas = [ [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]] maior = marca = media = contador = maior1 = maior2 = maior3 = maior4 = maior5 = maior6 = maiorN = anoo = 0 for l in range(0, 4): for c in range(0, 6): vendas[l][c] = int(input("Digite os dados para a tabela: ")) for l...
class Solution: def maxAbsValExpr(self, arr1: List[int], arr2: List[int]) -> int: result = 0 n = len(arr1) dirs = [[1, 1], [1, -1], [-1, 1], [-1, -1]] for x, y in dirs: right = x * arr1[0] + y * arr2[0] + 0 for i in range(n): left = x * arr1[i]...
#Create a range from 0 to 50, excluding 50. rng = range(0, 50) print(list(rng)) #=============================== #Create a range from 0 to 10 with steps of 2. rng = range(0, 10, 2) print(list(rng)) #========================== #Create a range from 100 to 160 with steps of 10. Then print it as a list. rng = range(10...
# # PySNMP MIB module Wellfleet-LAPB-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-LAPB-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:40:47 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, ...
# Elabora una Calculadora suma, resta, multiplicación, división (Con funciones sin retorno y con funciones con valores de retorno). # Calculadora con retornos n1 = int(input("Ingrese primer número: ")) n2 = int(input("Ingrese segundo número: ")) op = input("Escoja operación + - * /: ") def operacion(n1, n2, op): ...
""" 032. Longest Valid Parentheses Example 1: Input: "(()" Output: 2 Explanation: The longest valid parentheses substring is "()" Example 2: Input: ")()())" Output: 4 Explanation: The longest valid parentheses substring is "()()" """ class Solution: def longestValidParentheses(self, s): "...
# https://leetcode.com/problems/coin-change-2/ class Solution: def change(self, amount: int, coins: list[int]) -> int: dp = [0 for _ in range(amount + 1)] dp[0] = 1 for coin in coins: for amount_idx in range(coin, len(dp)): dp[amount_idx] += dp[amount_idx - coin]...
# Map # Looping without a loop # Basic usage - count len people = ['Matt', 'Bryan', 'Nicole', 'Tammy'] # OLD way '''count = [] for x in people: count.append(len(x)) print(f'Old way:\n{count}')''' # MODERN way print(f'Map function:\n{list(map(len,people))}') # COMBINE ELEMENTS # Notice different lengs, we are...
# returns minimum value from list of bms data parameter def bms_param_min(bms_param_data): if len(bms_param_data) !=0: return round(min(bms_param_data),3) return "Data not available" # returns maximum value from list of bms data parameter def bms_param_max(bms_param_data): if len(bms_param_data) !=...
#!/usr/bin/env python # encoding: utf-8 ''' @author: caroline @license: (C) Copyright 2019-2022, Node Supply Chain Manager Corporation Limited. @contact: caroline.fang.cc@gmail.com @software: pycharm @file: chain_getBlock.py @time: 2020/1/8 5:22 下午 @desc: ''' ''' 1. chain_getblock 作用:用于获取区块信息 参数: height usage: 当前区块高...
# -*- coding: utf-8 -*- def accept_command(command): car = command['car'] car_type = command['car_type'] param_1 = command['param_1'] param_2 = command['param_2'] print(car, car_type, param_1, param_2) # 即接口处理函数 # 调用方法后根据返回的参数返回是否接受命令成功,暂定为成功 flag = True return flag
# # PySNMP MIB module STN-SYSTEM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/STN-SYSTEM-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:11:42 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- '元类的练习' __author__ = 'Jacklee' # 导入模块 #import types # 静态定义的类 # 定义了Hello类,有一个方法hello,传入一个名称参数,打印输入'Hello, ' & name class Hello(object): def hello(self, name = 'world'): print('Hello, %s' % name) # type()函数动态创建 # 先定义方法函数 def fn(self, name = 'world'): print('Hello, ...
stuff = [] x = True while x is True: y = input("") if y.lower() != 'done': stuff.append(y) else: print(stuff) print(len(stuff)) break
# Define the path to the DNSMasq Lease file dnsmasq_lease_file = '/var/lib/misc/dnsmasq.leases' # Read list of hosts to ping from csv file ping_hosts ping_hosts = 'ping_hosts'
def main(): l,mn,ma = list(map(int, input().split())) if mn>l : mn = l if ma>l : ma = l mn_sum = l-mn+1 c = 1 for i in range(mn-1): c *= 2 mn_sum += c c = 1 mx_sum = 1 for i in range(1,ma): c *= 2 mx_sum += c mx_sum += (l-ma)*c ...
total = int(input()) # おつり change = 1000 - total coins = (500, 100, 50, 10, 5, 1) ans = 0 for price in coins: # 大きい硬貨から引けるだけ引く while (change - price) >= 0: change -= price ans += 1 print(ans)
class Solution: """ @param S: a string @return: return a list of strings """ def letterCasePermutation(self, S): # write your code here upper = sum(c.isalpha() for c in S) result = [] for i in range(1 << upper): b = 0 word = [] for ...
# Collection.find() function with hardcoded values myColl = db.get_collection('my_collection') myRes1 = myColl.find('age = 15').execute() # Using the .bind() function to bind parameters myRes2 = myColl.find('name = :param1 AND age = :param2').bind('param1','jack').bind('param2', 17).execute() # Using named p...
courses = ['History', 'Math', 'Physics', 'CompSci'] for item in courses: print(item) # loop with an index for index, course in enumerate(courses): print(index, course) # loop with a starting index value for index, course in enumerate(courses, start=1): print(index, course)
# settings.py - place to store constants for template-gen ACS_API = '2016-03-30' BASE_API = '2016-09-01' COMP_API = '2017-03-30' #COMP_API = '2016-04-30-preview' INSIGHTS_API = '2015-04-01' INSIGHTS_METRICS_API = '2016-03-01' INSIGHTS_PREVIEW_API = '2016-06-01' MEDIA_API = '2015-10-01' NETWORK_API = '2016-09-01' STORA...
fileref = open("olympics.txt", "r") ## Mind it the file should be in the same folder of the program execution. lines = fileref.readlines() print(len(lines)) total_char = 0 for line in lines: total_char += len(line) print(line.strip()) print(total_char) fileref.close()
################################################################################ # # Author: francescodilillo # Purpose: practice with dictionaries # Last Edit Date: 18-03-2020 # # ################################################################################ person = {"name": "Francesco", "gender": "M", "age": 27,...
""" Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: Input: 3 Output: [ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ] ] """ class Solution(object): def generateMatrix(self, n): """ :type n: int :rtype: List[List[int]] ""...
""" Exceptions. """ class OperationFailError(Exception): """Operation fail exception.""" pass class TaskNameDuplicateError(Exception): """Duplicate task name exception.""" pass class TaskNotFoundError(Exception): """Task is not registered in schedule manager.""" pass class TimeFormatError(Ex...
EXPERIMENTAL_MODE = True # header chunk id HEADER = 0x1 class Chunks13: SHADERS = 0x2 VISUALS = 0x3 PORTALS = 0x4 LIGHT_DYNAMIC = 0x6 GLOWS = 0x7 SECTORS = 0x8 VB = 0x9 IB = 0xa SWIS = 0xb class Chunks12: SHADERS = 0x2 VISUALS = 0x3 PORTALS = 0x4 LIGHT_DYNAMIC = 0...
""" Author: Samrat Banerjee Date: 01-06-2018 Description: Names, Variables, Code, Functions """ # this one is like your scripts with argv def print_two(*args): arg1, arg2=args print("arg1: %r,arg2: %r"%(arg1,arg2)) # ok, that *args is actually pointless, we can just do this def print_two_again(arg1,arg2): ...
class Solution: # time: O(1) # space: O(1) def findComplement(self, num: int) -> int: i = 1 while i <= num: i = i << 1 return (i - 1) ^ num
def anagrams(word, words): #your code here word_list = list(word) word_list.sort() l = [] for i in words: j = list(i) j.sort() if(j == word_list): l.append(i) return l
#!/usr/bin/env python3 #! @author: @ruhend(Mudigonda Himansh) ''' Here in this program i have used one function to do both the encoding and decoding part of it. this works with the basic principle, of division. while division the remainder is returned. Encoding doesnt make use of it, but while decoding...
class ExerciseStep: def __init__(self, main_text:str, sub_text=""): self.main_text = main_text self.sub_text = sub_text
class BackEnd: def __init__(self, id, Nome, Descricao, Versao): self.id = id self.nome = Nome self.descricao = Descricao self.versao = Versao def __str__(self): return f"{self.id},{self.nome},{self.descricao},{self.versao}"
_base_ = [ '../_base_/models/faster_rcnn_r50_fpn.py', '../_base_/datasets/rect_blur_detection.py', '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py'] optimizer = dict(type='SGD', lr=0.0005, momentum=0.9, weight_decay=0.0001) model = dict( roi_head=dict( type='DoubleHeadRoIHe...
trip_price = float(input()) money_balance = float(input()) spend_times = 0 days_count = 0 while spend_times < 5 and money_balance < trip_price: action = input() sum = float(input()) days_count += 1 if action == "spend": spend_times += 1 if sum >= money_balance: money_balanc...
def floodFill(graph, visited, start): if (start == -1): return(0) s = 0 if (not visited[start]): s += 1 visited[start] = 1 for v in graph[start]: s += floodFill(graph, visited, v) return(s) size = int(input()) graph = [[] for i in range(size)] for i in range(...
def keyword_from_deeper_submodule(): return 'hi again' class Sub: def keyword_from_class_in_deeper_submodule(self): return 'bye'
# Pulled from Scikit-Learn's official Github Repo (18 Sep 2020) to speed up 'caer' package import speeds (since this was the only method referenced from sklearn) MAXPRINT = 50 class spmatrix(object): """ This class provides a base class for all sparse matrices. It cannot be instantiated. Most of the work is...
""" Copyright: MAXON Computer GmbH Author: Maxime Adam Description: - Example to customize the icon used for a script. - The icon should be named like the .py file. - Should be a TIF with a size of 32x32. """
#!/usr/bin/python # -*- coding: utf-8 -*- print("Note : Starting GUI...")
# coding:utf-8 def favorite_book(book): print("My favorite book is " + book + ".") favorite_book("《python 从入门到实践》")
# # PySNMP MIB module CISCO-CDSTV-INGESTMGR-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-CDSTV-INGESTMGR-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:53:05 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 9 13:59:28 2020 @author: Muhammad """ # Parsing a text file for numerical data covid = open('COVID.txt') word_list = covid.read().split() numbers = [int(x) for x in word_list if x.isdigit()] #numbers.sort() print(numbers) covid.close()
# you can write to stdout for debugging purposes, e.g. # print("this is a debug message") def solution(S, P, Q): # write your code in Python 3.6 A = [0]*len(S) APrefixSum = [0]*len(S) C = [0]*len(S) CPrefixSum = [0]*len(S) G = [0]*len(S) GPrefixSum = [0]*len(S) T = [0]*le...
#! /usr/bin/env python # coding: utf-8 class ClientError(Exception): def __init__(self): pass class BadRequest(ClientError): def __init__(self, key, detail=None): self.key = key self.detail = detail class ConflictRequest(ClientError): def __init__(self, detail=None): ...
class TimeRegister: def __init__(self, emp_id, date, hours): self.emp_id = emp_id self.date = date self.hours = hours def get_emp_id(self): return self.emp_id def set_emp_id(self, new_id): self.emp_id = new_id def get_date(self): return self.__date d...
# import levels YES = 'y' NO = 'n' INDENT = ' ' NAME_CHARS = (' ', ',', '-', '.') # ============================================================================== # I/O # ============================================================================== def in_print(s: str, indent: int=0): print(f'{INDENT * inden...
def isPalindrome (input): input = [int(i) for i in str(input)] length = int(len(input)) if length % 2 == 0: part1 = (input[0: int(length / 2)]) part2 = (input[int(length / 2):]) part2 = list(reversed(part2)) else: part1 = (input[0: int(length // 2)]) part...
source_urls = { "2014": [ "https://raw.githubusercontent.com/tech-conferences/conference-data/master/conferences/2014/javascript.json", "https://raw.githubusercontent.com/tech-conferences/conference-data/master/conferences/2014/ruby.json", "https://raw.githubusercontent.com/tech-conferences/...
""" day 8 of Advent of Code 2018 by Stefan Kruger """ class DataProvider: def __init__(self, data): self.cursor = 0 self.data = data @classmethod def read_file(cls, filename="data/input8.data"): with open(filename) as f: return cls([int(item) for item in f.read().split...
class Solution: def maxValue(self, events: List[List[int]], k: int) -> int: e = sorted(events) @lru_cache(None) def dp(i, k): if k == 0 or i == len(e): return 0 # binary search events to find the first index j s.t. e[j][0] > e[i][1] j = bisect.bisect(e, [e[i][1], math.inf, math...
l,r = input().split() l,r = int(l), int(r) if l == 0 and r == 0: print("Not a moose") elif l == r: print("Even", l+r) elif l != r: mx = max(l,r) print("Odd", mx*2)
bot_fav_color = "blue" # Creating a parent class to use for various games class Player: def __init__(self, name, fav_color): self.name = name self.fav_color = fav_color def __str__(self): if self.fav_color == "blue": return f"Hi {self.name}! My favorite color is...
# subtraction with two number with user input a = int(input("Enter The First Value:")) b = int(input("Enter The Seceond Value:")) if a>b: Subtraction = a - b # In capital letters print("subtraction OF:",Subtraction) else: subtraction = b - a # Small...
# Copyright 2020 The Elekto 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 law or agreed to in wr...
# # PySNMP MIB module SPAGENT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SPAGENT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:02:25 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...
class Solution: """ @param num: Given the candidate numbers @param target: Given the target number @return: All the combinations that sum to target """ def combinationSum2(self, num, target): # write your code here self.results = [] if not num or len(num) == 0: ...
class ShippingMethodType: PRICE_BASED = "price" WEIGHT_BASED = "weight" CHOICES = [ (PRICE_BASED, "Price based shipping"), (WEIGHT_BASED, "Weight based shipping"), ] class PostalCodeRuleInclusionType: INCLUDE = "include" EXCLUDE = "exclude" CHOICES = [ (INCLUDE, "...
# Create a variable called 'name' that holds a string name = "Homer Simpson" # Create a variable called 'country' that holds a string country = "United States" # Create a variable called 'age' that holds an integer age = 25 # Create a variable called 'hourly_wage' that holds an integer hourly_wage = 15 # Create a v...
# Joshua Nelson Gomes (Joshua) # CIS 41A Spring 2020 # Unit C Take-Home Assignment # First Script - Working with List list1 = list() list1.extend([1,3,5]) list2 = [1, 2, 3, 4] list3 = list1 + list2 print (f'd) list3 is: {list3}') print (f'e) list3 contains a 3: {3 in list3}') print (f'f) list3 contains {list3.count...
class Solution: def findMissingRanges(self, nums: List[int], lower: int, upper: int) -> List[str]: # need to consider low and upper element because res.append(str(nums[i]+1)) and we use range 2 (nums[i+1] - nums[i] == 2) # for example: [1], low = 0, upper = 100. nums = [lower-1] + nums + [u...
with open("input.txt") as f: lines = [line.strip() for line in f.readlines()] tiles = {} # (e, ne) => is_black # decomposes a movement direction on a hex grid to one or two movements in two axes (this allows for unique coords) def decompose(direction: str) -> list: if direction == "se": return ["e",...
__name__ = "lbry" __version__ = "0.44.1" version = tuple(__version__.split('.'))
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2021 CaptainSword123 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, co...
class MSImageCollection(object): def __init__(self, images): self._images = images @property def images(self): # <list> return self._images
class ResourceNames(): def __init__(self, log_group_name: str, log_stream_name: str): self.log_group_name = log_group_name self.log_stream_name = log_stream_name def get_log_group_name(self) -> str: return self.log_group_name def get_log_stream_name(self) -> str: ...
n = int(input()) num1 = "" num2 = "" num3 = "" num4 = "" for a in range(1111, 9999 + 1): num1 = str(a)[0] num2 = str(a)[1] num3 = str(a)[2] num4 = str(a)[3] if int(num1) != 0 and int(num2) != 0 and int(num3) != 0 and int(num4) != 0: if n % int(num1) == 0 and n % int(num2) == 0 and n % int(nu...
IR_Sensor_1 = 6 #GPIO number IR_Sensor_2 = 13 #GPIO number IR_Sensor_3 = 19 #GPIO number IR_Sensor_4 = 26 #GPIO number IR_Sensor_5 = 12 #GPIO number IR_Sensor_6 = 16 #GPIO number IR_Sensor_7 = 20 #GPIO number IR_Sensor_8 = 21 #GPIO number I_Restart = 5 #GPIO number I_Pair = 11 #GPIO number IR_time = 500 # time in ms Re...
class Solution(object): def moveZeroes(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ last_non_zero = 0 for cur in range(len(nums)): if nums[cur] != 0: nums[cur], nums[last_non_zero] = nums[last_non_zero]...
__title__ = 'MeteorTears' __description__ = 'Even the most boring times in life are limited.' __url__ = 'https://github.com/xiaoxiaolulu/MeteorTears' __version__ = '1.0.1' __author__ = 'Null' __author_email__ = '546464268@qq.com' __license__ = 'MIT' __copyright__ = 'Copyright 2018 Null'
"""Custom execeptions for Cartola FC Draft.""" class SchemeError(Exception): """Indicates that the Line-up does not follow the scheme."""
# 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 binaryTreePaths(self, root: Optional[TreeNode]) -> List[str]: result = [] path = [] ...
# List of permitted AST toplevel statements. In IMPORTs (e.g. sgr import # and Splitfile IMPORT commands), we only allow read-only SELECTs. In Splitfile # SQL commands, we also allow users to use a bunch of writeable DML and DDL. IMPORT_SQL_PERMITTED_STATEMENTS = ["RawStmt", "SelectStmt"] SPLITFILE_SQL_PERMITTED_STATE...
class MultiprocessingUtils(object): @staticmethod def get_array_split_indices(array_length, thread_count): array_length += 1 indices = range(0, array_length, array_length / thread_count)[:thread_count] indices.append(array_length) return indices @staticmethod def star...
def smallestDifference(arrayOne, arrayTwo): arrayOne.sort() arrayTwo.sort() ans = [0, float('inf')] i = j = 0 while i < len(arrayOne) and j < len(arrayTwo): if abs(ans[0] - ans[1]) > abs(arrayOne[i] - arrayTwo[j]): ans[0], ans[1] = arrayOne[i], arrayTwo[j] if ans[...
""" Entradas litros-->float-->l Salidas litros_comprados-->float-->l_c Nota: 1 Galon= 3.785 Litro 1 litro = 50000 COP """ l=float(input("Ingrese la cantidad de litros comprados ")) l_c=(l/3.785)*(3.785*50000) print("El total a pagar es: "+str(l_c)+" COP")
CATEGORIES = ["Gents", "Ladies", "Giants", "Boys", "Girls", "Kids", "Children"] BRANDS = [ "", "PRIDE", "DEBONGO", "VKC DEBONGO", "KAPERS", "STILE", "L.PRIDE", "SMARTAK", ]
# Reescreva a função leiaInt() que fizemos no desafio 104, incluindo agora a possibilidade # da digitação de um número de tipo inválido. Aproveite e crie também uma função leiaFloat() # com a mesma funcionalidade. #função def leiaInt(msg): while True: try:#----> Tente n = int(input(msg...
murder_note = "You may call me heartless, a killer, a monster, a murderer, but I'm still NOTHING compared to the villian that Jay was. This whole contest was a sham, an elaborate plot to shame the contestants and feed Jay's massive, massive ego. SURE you think you know him! You've seen him smiling for the cameras, laug...
class ColorTerminal: prRed = '\033[91m' prGreen = '\033[92m' prLightPurple = '\033[94m' prCyan = '\033[96m' endc = '\033[0m'
class Solution: def generate(self, numRows: 'int') -> 'List[List[int]]': if numRows<1: return [] rst = [] if numRows == 1: rst.append([1]) elif numRows == 2: rst.append([1]) rst.append([1,1]) else: rst.append([1]) ...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # file: $Id$ # auth: Philip J Grabner <phil@canary.md> # date: 2016/09/14 # copy: (C) Copyright 2016-EOT Canary Health, Inc., All Rights Reserved. #--------------------------------------------------------------------...
a = int(input()) b = int(input()) if a == b: print(0) elif a > b: print(1) else: print(2)
############################################################################ # Generic script applicable on any Operating Environments (Unix, Windows) # ScriptName : wls_deploy.py # Properties : weblogic.properties test.properties # Author : Kevin Yuan ######################################################...
class DroneTemplate: __attr__ = ('id', 'name', 'namespace', 'data') def __init__(self, data: dict): self._data = data @property def id(self): return self._data.get('id') @property def name(self): return self._data.get('name') @property def namespace(self): ...
class Error(Exception): """Base-class for all exceptions raised by this module.""" class ConfidentialsNotSuppliedError(Error): """An API key and an API sectret must be supplied.""" class BearerTokenNotFetchedError(Error): """Couldn't fetch the bearer token.""" class InvalidDownloadPathError(Error): ...
A = float(raw_input()) B = float(raw_input()) MEDIA = ((A*3.5)+(B*7.5))/11 print ("MEDIA = %.5f" %MEDIA)
for _ in range(int(input())): n=int(input()) l=list(map(int,input().split())) if len(set(l))<n: print("YES") else: print("NO")
def ParseXMLWithXPath(xmlString, xpath): return
# # PySNMP MIB module ZXR10-T128-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZXR10-T128-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:42:31 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
print(""" You have succesfully created `{{ cookiecutter.repository_slug }}` with these cookiecutter parameters: {% for key, value in cookiecutter.items()|sort %} {{ "{0:24}".format(key + ":") }} {{ "{0!r}".format(value).strip("u") }} {%- endfor %} ----------------------------------------------------------------- N...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 22 18:06:36 2022 @author: victor """ alien = {'color': 'green', 'points': 5} print("The Alien's color is " + alien['color'])
class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ index={} for i,num in enumerate(nums): if target - num in index: return [index[target - num] + 1,i+1] ...
class Solution: def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """