content
stringlengths
7
1.05M
# 将一个给定字符串根据给定的行数,以从上往下、从左到右进行 Z 字形排列。 # 比如输入字符串为 "LEETCODEISHIRING" 行数为 3 时,排列如下: # L C I R # E T O E S I I G # E D H N # 之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:"LCIRETOESIIGEDHN"。 # 请你实现这个将字符串进行指定行数变换的函数: # string convert(string s, int numRows); # 示例 1: # 输入: s = "LEETCODEISHIRING", numRows = ...
def factorial(n): if n < 2: return 1 return n * factorial(n - 1) def main(): n=6 print(factorial(n)) main()
numbers = [int(n) for n in input().split(' ')] n = len(numbers) for i in range(n): for j in range(0, n - i - 1): if numbers[j] > numbers[j + 1]: numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j] print(' '.join([str(n) for n in numbers]))
def write_keyfile(data , generator): ''' 将data写成 semeval 2018 task7 key file的格式 entity名:doc_id.entity_number ''' relations = generator.relations #gene_no_rel = generator.gene_no_rel #no_rel = generator.no_rel cont = "" for x in data: got_relations = [] # format: (u,v) for u < v for r in x.ans: u,v...
# coding: utf8 # try something like def index(): '''main page that allows searching for and displaying audio listings''' #create search form formSearch = FORM(INPUT(_id='searchInput', requires=[IS_NOT_EMPTY(error_message='you have to enter something to search for'), IS_LENGTH(50, error_message='you can\'t have su...
class Result: """Class description.""" def __init__(self): """ Initialization of the class. """ pass def __str__(self): return
class Building(object): """Class representing all the data for a building 'attribute name': 'type' swagger_types = { 'buildingId': 'str', 'nameList': 'list[str]', 'numWashers': 'int', 'numDryers': 'int', } 'attribute name': 'Attribute name in Swagger Docs' attribute_map = { 'buildingId': 'buildingId...
# Register the HourglassTree report addon register(REPORT, id = 'hourglass_chart', name = _("Hourglass Tree"), description = _("Produces a graphical report combining an ancestor tree and a descendant tree."), version = '1.0.0', gramps_target_version = '5.1', status = STABLE, fname = 'hourglasstree.p...
class SolidSurfaceLoads: def sfa(self, area="", lkey="", lab="", value="", value2="", **kwargs): """Specifies surface loads on the selected areas. APDL Command: SFA Parameters ---------- area Area to which surface load applies. If ALL, apply load to all ...
class RLPException(Exception): """Base class for exceptions raised by this package.""" pass class EncodingError(RLPException): """Exception raised if encoding fails. :ivar obj: the object that could not be encoded """ def __init__(self, message, obj): super(EncodingError, self).__ini...
def make_car(manufacturer, model, **extra_info): """Make a car dictionary using input information.""" car = {} car['manufacturer'] = manufacturer car['model'] = model for key, value in extra_info.items(): car[key] = value return car car = make_car('subaru', 'outback', color='blue', to...
# # PySNMP MIB module Nortel-Magellan-Passport-PppMIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-PppMIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:18:42 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Pytho...
""" Write a class called MyCounter that counts how many times it was initialised, so the following code: for _ in range(10): c1 = MyCounter() print MyCounter.count should print 10 """
# # This file contains the Python code from Program 9.8 of # "Data Structures and Algorithms # with Object-Oriented Design Patterns in Python" # by Bruno R. Preiss. # # Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved. # # http://www.brpreiss.com/books/opus7/programs/pgm09_08.txt # class Tree(Containe...
x = int(input("Insert some numbers: ")) ev = 0 od = 0 while x > 0: if x%2 ==0: ev += 1 else: od += 1 x = x//10 print("Even numbers = %d, Odd numbers = %d" % (ev,od))
'''A special two digit number is a number such that when the sum of its digits is added to the product of its digits, the result should be equal to the original two-digit number. Implement a program to accept a two digit number and check whether it is a special two digit number or not. Input Format a two digit number...
def latex_template(name, title): return '\n'.join((r"\begin{figure}[H]", r" \centering", rf" \incfig[0.8]{{{name}}}", rf" \caption{{{title}}}", rf" \label{{fig:{name}}}", r" \vspace{-0.5cm}",...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Замыкание функций которое увеличивает аргумент на 3 def func(a): # Функция, несмотря на отсутсвие аргументов, успешно вычисляет а+3 def mul(): return a + 3 return mul()
# -*- coding: utf-8 -*- __author__ = 'nakaokataiki' def get_htmltemplate(): """ レスポンスとして返すHTMLのうち、定形部分を返す。 """ html_body = u""" <!DOCTYPE html> <html> <head> <title>{title}</title> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <li...
# @kwargs - extendable parameter list of the form var1=[a1, a2, .., an], var2=[b1, b2, ..., bn], ... # @value - list of parameter permutations of the form [(a1, b1, ...), (a1, b2, ...), (a2, b1, ...), ...] def cv_grid(**kwargs): """Returns a list of parameter tuples from the grid. Each tuple is a unique permut...
""" MIT License Copyright (c) 2020-2022 EntySec 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, publish, ...
# -*- coding: utf-8 -*- # Статусы заказов STATUS_CREATED = 0 STATUS_SUCCESS = 1 STATUS_FAIL = 2 STATUS = ( (STATUS_CREATED, 'Created'), (STATUS_SUCCESS, 'Success'), (STATUS_FAIL, 'Fail'), ) # Статусы заказа в Robokassa todo проверять через XML-интерфейс ROBOKASSA_STATUS = ( (5, 'Initialized'), (10...
""" ID: duweira1 LANG: PYTHON2 TASK: test """ fin = open ('test.in', 'r') fout = open ('test.out', 'w') x,y = map(int, fin.readline().split()) sum = x+y fout.write (str(sum) + '\n') fout.close()
"""Quiz Game using Dictionary""" """ Stpes: 1. Create a dictionary containing questions and answers 2. Loop through diction 3. """ question_and_answer = { "What is the capital of India?": "New Delhi", "What is the capital of USA?": "Washington", "What is the capital of UK?": "London", "Wh...
# Python3 # 有限制修改區域 def twinsScore(b, m): return [*map(sum, zip(b, m))]
# [카카오] 비밀지도 def solution(n, arr1, arr2): result = [] for i in range(n): result.append((arr1[i] | arr2[i])) ret = [] for i in range(n): string = "" for j in range(n): if result[i] & (1 << j): string = "#" + string else: st...
# Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """ This file contains indexing suite v2 code """ file_name = "indexing_suite/slice.hpp" code = """// Header file ...
""" File: anagram.py Name: ---------------------------------- This program recursively finds all the anagram(s) for the word input by user and terminates when the input string matches the EXIT constant defined at line 19 If you correctly implement this program, you should see the number of anagrams for each word liste...
houses = {(0, 0)} with open('Day 3 - input', 'r') as f: directions = f.readline() current_location = [0, 0] for direction in directions[::2]: if direction == '^': current_location[1] += 1 houses.add(tuple(current_location)) elif direction == '>': current_...
print('1. Was sind Maskierungssequenzen?') input() print('Maskierungszeichen stehen für Zeichen die sonst nur\nschwer in einem Code wiedergeben lassen') print(r'Beispiele: \n für newline \t für tabulator \\ für backslash ... ') print('') input() print('2. Wofür stehen die Maskierungssequenzen \\t und \\n') input() pri...
class Profile: def __init__(self, id, username, email, allowed_buy, first_name, last_name, is_staff, is_current, **kwargs): self.id = id self.user_name = username self.email = email self.allowed_buy = allowed_buy self.first_name = first_name self.last...
#!/usr/bin/env python class Graph: def __init__(self, n, edges): # n is the number of vertices # edges is a list of tuples which represents one edge self.n = n self.V = set(list(range(n))) self.E = [set() for i in range(n)] for e in edges: v, w = e ...
''' Adapt the code from one of the functions above to create a new function called 'multiplier'. The user should be able to input two numbers that are stored in variables. The function should multiply the two variables together and return the result to a variable in the main program. The main program should output the ...
my_dictionary={ 'nama': 'Elyas', 'usia': 19, 'status': 'mahasiswa' } my_dictionary["usia"]=20 print(my_dictionary)
""" n = 4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 count: i + 1 f(i, j) = i (i + 1) / 2 + 1 + j 1 + 2 + 3 + 4 + ... + n = n (n + 1) / 2 """ n = int(input()) # k = 1 # for i in range(n): # for _ in range(i + 1): # print(k, end=' ') # k += 1 # print() """ Time Complexity: O(n^2) Space Complexity: ...
#!/usr/bin/env python3 #encoding=utf-8 #------------------------------------------------ # Usage: python3 3-decorator2.py # Description: Tracer call with key-word only #------------------------------------------------ class Tracer: # state via instance attributes def __init__(self, func): # ...
# -*- coding: utf-8 -*- ''' File name: code\counting_the_number_of_hollow_square_laminae_that_can_form_one_two_three__distinct_arrangements\sol_174.py Author: Vaidic Joshi Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #174 :: Counting the number of "hollow" squ...
""" The `~certbot_dns_google.dns_google` plugin automates the process of completing a ``dns-01`` challenge (`~acme.challenges.DNS01`) by creating, and subsequently removing, TXT records using the Google Cloud DNS API. Named Arguments --------------- ======================================== =========================...
"""Constants for the Subaru integration.""" DOMAIN = "subaru" FETCH_INTERVAL = 300 UPDATE_INTERVAL = 7200 CONF_UPDATE_ENABLED = "update_enabled" CONF_COUNTRY = "country" # entry fields ENTRY_CONTROLLER = "controller" ENTRY_COORDINATOR = "coordinator" ENTRY_VEHICLES = "vehicles" # update coordinator name COORDINATOR_...
# Faça um programa que leia três números e mostre # qual é o Maior e qual é o Menor. a = int(input('\033[34;43mPrimeiro valor:\033[m ')) b = int(input('\033[32;44mSegundo valor:\033[m ')) c = int(input('\033[32;47mTerceiro valor:\033[m ')) # Verificando quem é o menor menor = a if b < a and b < c: menor = b if c < ...
# Enter your code here. Read input from STDIN. Print output to STDOUT class TwoStackQueue: def __init__(self): self.forward_stack = [] self.reverse_stack = [] def dequeue(self): if not self.reverse_stack: while self.forward_stack: self.reverse_stac...
############################################################################## # # Copyright (c) 2005 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
N, K = map(int, input().split()) result = 0 while N != 0: result += 1 N //= K print(result)
EXPECTED_SECRETS = [ "EQ_SERVER_SIDE_STORAGE_USER_ID_SALT", "EQ_SERVER_SIDE_STORAGE_USER_IK_SALT", "EQ_SERVER_SIDE_STORAGE_ENCRYPTION_USER_PEPPER", "EQ_SECRET_KEY", "EQ_RABBITMQ_USERNAME", "EQ_RABBITMQ_PASSWORD", ] def validate_required_secrets(secrets): for required_secret in EXPECTED_SEC...
"""Top-level package for NEMO CF.""" __author__ = """Willi Rath""" __email__ = 'wrath@geomar.de' __version__ = '0.1.0'
{ "targets": [{ "target_name": "fuse", "include_dirs": [ "<!(node -e \"require('napi-macros')\")", "<!(node -e \"require('fuse-shared-library/include')\")", ], "libraries": [ "<!(node -e \"require('fuse-shared-library/lib')\")", ], "sources": [ "fuse-native.c" ], ...
def split_list(list, n): target_list = [] cut = int(len(list) / n) if cut == 0: list = [[x] for x in list] none_array = [[] for i in range(0, n - len(list))] return list + none_array for i in range(0, n - 1): target_list.append(list[cut * i:cut * (1 + i)]) target_list...
# # This file contains the Python code from Program 15.18 of # "Data Structures and Algorithms # with Object-Oriented Design Patterns in Python" # by Bruno R. Preiss. # # Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved. # # http://www.brpreiss.com/books/opus7/programs/pgm15_18.txt # class RadixSorter...
# KATA MODULO 07 # EJERCICIO 01 # # Declara dos variables planets = [] # Comenzando con las variables que acabas de crear, crearás un ciclo while. # El ciclo while se ejecutará mientras el new_planet no sea igual a la palabra 'done'. # Dentro del ciclo, comprobarás si la variable new_planet contiene u...
extensions = dict( required_params=[], # empty to override defaults in gen_defaults validate_required_params=""" # Required args: either model_key or path if (is.null(model_key) && is.null(path)) stop("argument 'model_key' or 'path' must be provided") """, set_required_params="", ) doc = dict( preamb...
somthing = 'F5fjDxitafeZwPdwsmBL-Q' key_api = 'MiT75-jn5D_6MENzkehT5EReeVdYhp_86hQKYQp-3o10wIVXAbOakIT6khg8Y-_PBiy2fKPuAQFp9x7W80Ubn3xdiS8eCfy-nc7qtLNvs6oyAzdU2CsCRHEniyJUYHYx'
""" link: https://leetcode.com/problems/evaluate-division problem: 离线解不定方程,给定 a/b=x1 , b/c=x2, 求解 a/c solution: 询问较多,用字典预算出所有可能的组合,时间复杂度O(n^2),将每个结果尝试相乘或相除看能否得到新的组合。 """ class Solution: def calcEquation(self, equations: List[List[str]], values: List[float], queries: List[List[str]]) -> List[float]: q, ...
class ListView(Control,IComponent,IDisposable,IOleControl,IOleObject,IOleInPlaceObject,IOleInPlaceActiveObject,IOleWindow,IViewObject,IViewObject2,IPersist,IPersistStreamInit,IPersistPropertyBag,IPersistStorage,IQuickActivate,ISupportOleDropSource,IDropTarget,ISynchronizeInvoke,IWin32Window,IArrangedElement,IBindableCo...
# -*- coding: utf-8 -*- ## courses table Course = db.define_table("courses", Field("title", label=T('Title')), Field("short_description", "text", label=T('Short Description')), Field("description", "text", widget=ckeditor.widget, label=T('Description')), Fiel...
def get_encoder_decoder_hp(model='gin', decoder=None): if model == 'gin': model_hp = { "num_layers": 5, "hidden": [64,64,64,64], "dropout": 0.5, "act": "relu", "eps": "False", "mlp_layers": 2, "neighbor_pooling_type": "sum"...
class Solution: def canConstruct(self, ransomNote: str, magazine: str) -> bool: count_r={} for c in ransomNote: if c not in count_r: count_r[c]=1 else: count_r[c]+=1 print(count_r) for cr in magazine: if cr n...
BOTTLE_CONTENT_MANAGER_API_PORT = 8081 BOTTLE_DEORATOR_PORTFOLIOS_API_PORT = 8082 BOTTLE_DEORATOR_TAGS_API_PORT = 8083 BOTTLE_DEORATOR_VOTES_API_PORT = 8084 USE_SOLR_AS_PERSISTENCE = True SOLR_URL = 'http://localhost:8983/solr' DECORATION_SOLR_FIELD_0 = 'portfolios' DECORATION_SOLR_FIELD_1 = 'tags'
""" > Task Some people are standing in a row in a park. There are trees between them which cannot be moved. Your task is to rearrange the people by their heights in a non-descending order without moving the trees. People can be very tall! > Example For a = [-1, 150, 190, 170, -1, -1, 160, 180], the output should be [-...
# keep a list of the N best things we have seen, discard anything else class nbest(object): def __init__(self,N=1000): self.store = [] self.N = N def add(self,item): self.store.append(item) self.store.sort(reverse=True) self.store = self.store[:self.N] d...
#f = open("datum/iris.csv") #print (f.read()) #f.close() #closing file is good practice #Using ff code will make closing file unnecessary with open("datum/iris.csv") as f: contents = (f.read()) print(contents)
def main(j, args, params, tags, tasklet): page = args.page logpath = args.requestContext.params.get('logpath') templatepath = args.requestContext.params.get('templatepath') installedpath = args.requestContext.params.get('installedpath') metapath = args.requestContext.params.get('metapath') dom...
# ==================================================================================== # # base_response.py - This file is part of the YFrake package. # # ------------------------------------------------------------------------------------ # # ...
def cargarListas(nombrearchivo,lista): try: archivo = open(nombrearchivo, "rt") while True: linea = archivo.readline() if not linea: break linea = linea[:-1] listaNombre, Articulos = linea.split("=") if Articulos.stri...
# Time: O(n^2 * k) # Space: O(k) class Solution(object): def maxVacationDays(self, flights, days): """ :type flights: List[List[int]] :type days: List[List[int]] :rtype: int """ if not days or not flights: return 0 dp = [[0] * len(days) for _ in ...
first_number = int(input()) prime_count = 0 while True: if 1>= first_number: break running_number = first_number divider = first_number // 2 if ( 0 == first_number % 2 ) else ( first_number // 2 ) + 1; count = 0 while divider != 1: if 0 == running_number % divider: c...
# # 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 # ...
# for item in ["mash","john","sera"]: # print(item) # for item in range(5,10,2): # print(item) # for x in range(4): # for y in range(3): # print(f"({x}, {y})") numbers = [5, 2 , 5 ,2 ,2] for item in numbers: output = "" for count in range(item): output += "X" print(output)
# Problem: https://www.hackerrank.com/challenges/30-data-types/problem # Score: 30.0 i = 4 d = 4.0 s = 'HackerRank ' x = int(input()) y = float(input()) z = input() print(i+x, d+y, s+z, sep='\n')
class ConsumerRegister: all_consumers = {} def __init__(self, name): self.name = name self.consumer_class = None def consumer(self): def decorator(plugin_cls): self.consumer_class = plugin_cls self.all_consumers[self.name] = { 'consumer_cls':...
# INSTRUCTIONS # Translate the text and write it between the " # EXAMPLE: original -> "This text is in english: value {0}" # translation -> "Aquest text està en anglès: valor {0}" # If you see sth like {0}, {1}, maintain it on the translated sentence # Meke special attention to elements like ":...
n1 = float(input("Digite um número: ")) n2 = float(input("Digite outro: ")) m = (n1 + n2) / 2 print('{:.2f}'.format(m))
class ConfigBase: def __init__(self,**kwargs): for k,v in kwargs.items(): setattr(self,k,v) @classmethod def get_class_config_info_dict(cls): if issubclass(cls.__base__, ConfigBase): dic=cls.__base__.get_class_config_info_dict() else: dic = {} ...
p = float(input('Digite seu peso: ')) a = float(input('Digite sua altuta: ')) imc =p / (a**2) print('Seu IMC é {:.2f}'.format(imc)) if imc< 18.5: print('Abaixo do peso') elif imc < 25: print('Peso ideal') elif imc < 30: print('sobre peso') elif imc < 40: print('Obesidade') else: print('obesidade mo...
def mergeSort(arr): if len(arr) >1: mid = len(arr)//2 L = arr[:mid] R = arr[mid:] mergeSort(L) mergeSort(R) i = j = k = 0 while i < len(L) and j < len(R): if L[i] < R[j]: arr[k] = L[i] i+= 1 els...
""" Concrete data service. This Django app manages API endpoints related to managing "concrete data", or data that serves as the foundational sources of truth for users. This is opposed to "derived data", which is data computed via mathematical, logical / relational, or other types of transformations. For example, a m...
pontos = [] posicoes = [] # Para verificar se os dedos estão dobrados ou esticados, # esta função faz a comparação da distancia entre pontos # e adiciona a lista de posições se o dedo está esticado, acima ou abaixo da base do dedo se está próximo ou afastado do dedo subsequente. # Para o dedo polegar, precis...
# -*- coding: utf-8 -*- """ Created on Sun Oct 11 10:18:56 2020 @author: Ashish """ def add_num(num1, num2): print("In module A") return num1+num2
#python 3.5.2 class Stack: def __init__(self): self.items = [] def isEmpty(self): self.items == [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[l...
# coding=utf-8 # 数据库配置 db_config = { 'db': 'cmdb' } page_config = { "brand_name": '51Reboot', 'title': 'hello reboot', "favicon": 'https://pic1.zhimg.com/6d660dd4156c64bfad13ff97d79c2f98_l.jpg', "menu": [ { # user配置最好不要修改,是和登陆认证相关的,直接在下面加配置即可 "name": 'user', ...
class TextManipulation: def formatText(text): newText = text.replace("&", "\n") return newText
def define_orthonormal_basis(u): """ Calculates an orthonormal basis given an arbitrary vector u. Args: u (numpy array of floats) : arbitrary 2-dimensional vector used for new basis Returns: (numpy array of floats) : new orthonormal basis ...
# Map query config QUERY_RADIUS = 3000 # mts. Radius to use on OSM data queries. MIN_DISTANCE_FOR_NEW_QUERY = 1000 # mts. Minimum distance to query area edge before issuing a new query. FULL_STOP_MAX_SPEED = 1.39 # m/s Max speed for considering car is stopped.
# Copyright 2021 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. """Module containing base test results classes.""" # The test passed. PASS = 'SUCCESS' # The test was intentionally skipped. SKIP = 'SKIPPED' # The test fa...
# THIS FILE IS GENERATED FROM PYWAVELETS SETUP.PY short_version = '0.3.0' version = '0.3.0' full_version = '0.3.0.dev-7ea3e91' git_revision = '7ea3e919b1d7bbf4d7685c47d3d10c16c599cd06' release = False if not release: version = full_version
#/usr/bin/env python3 """ Solution to problem: https://practice.geeksforgeeks.org/problems/adding-ones/0 We reduced the runtime of algorithm from O(nm) to O(n+m) resulting in half the time running """ def get_array(array, n): """ gets the array Gets input and returns final computed value Parameters:...
''' Create a function that sums two arguments together. If only one argument is provided, then return a function that expects one argument and returns the sum. For example, addTogether(2, 3) should return 5, and addTogether(2) should return a function. Calling this returned function with a single argument will the...
class ConfigHandlerException(Exception): """Main Config Handler Exception class""" class ConfigHandlerFileReadException(ConfigHandlerException): """Config Handler ConfigFile Read Exception class""" class ConfigHandlerNamingException(ConfigHandlerException): """Config Handler Naming Exception class"""
class Solution(object): def findTheDifference(self, s, t): """ :type s: str :type t: str :rtype: str """ return chr(reduce(lambda a, b: a ^ ord(b), s + t, 0))
exp_name = 'prenet_c32s6d5_lstm' work_dir = f'./work_dirs/{exp_name}' # model settings model = dict( type='MultiStageRestorer', generator=dict( type='PReNet', in_channels=3, out_channels=3, mid_channels=32, recurrent_unit='LSTM', num_stages=6, num_resbloc...
# Crie um programa que leia vários números inteiros pelo teclado. O programa só vai parar quando o usuário digitar o valor 999, que é a condição de parada. No final, mostre quantos números foram digitados e qual foi a soma entre eles (desconsiderando o flag). n = c = soma = 0 n = int(input('Digite os numeros para obte...
class SchedulableField(object, IDisposable): """ A non-calculated field eligible to be included in a schedule. SchedulableField(fieldType: ScheduleFieldType,parameterId: ElementId) SchedulableField(fieldType: ScheduleFieldType) SchedulableField() """ def Dispose(self): """ Disp...
def findDecision(obj): #obj[0]: Coupon, obj[1]: Education, obj[2]: Occupation, obj[3]: Restaurant20to50, obj[4]: Distance # {"feature": "Coupon", "instances": 127, "metric_value": 0.9671, "depth": 1} if obj[0]>0: # {"feature": "Occupation", "instances": 111, "metric_value": 0.9353, "depth": 2} if obj[2]<=7.990990...
class AgentException(Exception): """ Base exception""" description = 'Unknown error' statuscode = 5 def __str__(self): return '{0}: {1}'.format(self.description, ' '.join(self.args)) class InactiveAgent(AgentException): description = "Agent is not activated"
a = 1 a = a + 2 print(a) a += 2 print(a) word = "race" word += " car" print(word)
''' Nome: Luiz Lima Cezario Ra:11201920808 Esse programa serve para analisar se uma quantidade determinada pelo primeiro numero entrado se os proximos fazem parte dos numeros de fibonacci ''' def FibonateAnalise(x:int)-> str: """ Esta funçao calcula os numeros de fibonacci, enquanto o numero fibonacci for m...
etc_dictionary = { '2 30대': '이삼십대', '20~30대': '이삼십대', '20, 30대': '이십대 삼십대', '1+1': '원플러스원', '3에서 6개월인': '3개월에서 육개월인', } english_dictionary = { 'Devsisters': '데브시스터즈', 'track': '트랙', # krbook 'LA': '엘에이', 'LG': '엘지', ...
# # Task description # This is a demo task. You can read about this task and its solutions in this blog post. # # A zero-indexed array A consisting of N integers is given. An equilibrium index of this array is any integer P such that 0 ≤ P < N and the sum of elements of lower indices is equal to the sum of elements of ...
# compare_versions.py # software library for question B def compare_versions(string1, string2): seperator = "." # first load the strings and then seperate the individual numbers into a list by # using the split function string1 = string1.split(seperator) string2 = string2.split(seperator) # l...
-8 # ---------------------------------------------------------------------------- # <copyright company="Aspose" file="HttpRequest.py"> # Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved. # </copyright> # <summary> # Permission is hereby granted, free of charge, to any person obtaining a # copy o...
class BaseSubmission: def __init__(self, team_name, player_names): self.team_name = team_name self.player_names = player_names def get_actions(self, obs): ''' Overview: You must implement this function. ''' raise NotImplementedError