content
stringlengths
7
1.05M
""" * Assignment: Type Float Altitude * Required: yes * Complexity: easy * Lines of code: 3 lines * Time: 3 min English: 1. Plane altitude is 10.000 ft 2. Data uses imperial (US) system 3. Convert to metric (SI) system 4. Result round to one decimal place 5. Run doctests - all must succeed Polish:...
headers = 'id,text,filename__v,format__v,size__v,charsize,pages__v' id_ = '31011' text = """Investigational Product Accountability Log """ filename__v = 'foo.docx' format__v = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' size__v = '16290' charsize = '768' pages__v = '1' row = ','.join([...
N = int(input()) h = N // 3600 % 24 min = N % 3600 // 60 sec = N % 60 print(h, '%02d' % (min), '%02d' % (sec), sep=':')
""" Implementation of an edge, as used in graphs """ ################################################################################ # # # Undirected # # ...
# # PySNMP MIB module CTRON-SFPS-PATH-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CTRON-SFPS-PATH-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:31:03 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
spec = { 'name' : "a 4-node liberty cluster", # 'external network name' : "exnet3", 'keypair' : "openstack_rsa", 'controller' : "r720", 'dns' : "10.30.65.200", 'credentials' : { 'user' : "nic", 'password' : "nic", 'project' : "nic" }, 'Networks' : [ # { 'name' : "liberty" , "start":...
COM_SLEEP = 0x00 COM_QUIT = 0x01 COM_INIT_DB = 0x02 COM_QUERY = 0x03 COM_FIELD_LIST = 0x04 COM_CREATE_DB = 0x05 COM_DROP_DB = 0x06 COM_REFRESH = 0x07 COM_SHUTDOWN = 0x08 COM_STATISTICS = 0x09 COM_PROCESS_INFO = 0x0a COM_CONNECT = 0x0b COM_PROCESS_KILL = 0x0c COM_DEBUG = 0x0d COM_PING = 0x0e COM_TIME = 0x0f COM_DELAYED_...
name, age = "Sharwan27", 16 username = "Sharwan27" print ('Hello!') print("Name: {}\nAge: {}\nUsername: {}".format(name, age, username))
# count = 10 # while count>0: # print("Sandip") # count-=1 # name="Sandip" # for char in name: # print(char) # for item in name: # print(item, end=" ") # print("") # print("My name is",name) # print("My name is",name,sep="=") # for item in range(5): # print(item,end=" ") # print("") # for item ...
# Copyright 2017 The Bazel 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 applicable la...
def potencia(base, inicio=1, fin=10): while inicio < fin: resul=base**inicio yield resul inicio=inicio+1 print(list(potencia(3,1,50)))
class CFApiException(Exception): """Base exception for all custom exceptions raise by the cfapi module.""" class InvalidIdentifierException(CFApiException, ValueError): """Raised when trying to load data from an invalid URL (probably because the data doesn't exist or isn't public).""" class InvalidURL(C...
N_L = input().split() Number_lights = int(N_L[0]) Length = int(N_L[1]) time = 0 last_distance = 0 for x in range(Number_lights): information = input().split() time += int(information[0]) - last_distance remainder = time % (int(information[1]) + int(information[2])) if remainder < int(inform...
PATH_TO_STANFORD_CORENLP = '/local/cfwelch/stanford-corenlp-full-2018-02-27/*' NUM_SPLITS = 1 TRAIN_SIZE = 0.67 # two thirds of the total data # Define entity types here # Each type must have a list of identifiers that do not contain the '_' token # Example of an annotation: # # Kathe Halverson was the only aspec...
# -*- coding: utf-8 -*- """DSM 5 SYNO.DSM.Network data.""" DSM_5_DSM_NETWORK = { "data": { "dns": ["192.168.1.1"], "gateway": "192.168.1.1", "hostname": "HOME-NAS", "interfaces": [ { "id": "eth0", "ip": [{"address": "192.168.1.10", "netmas...
#!/usr/bin/env python #=================================================================================== #description : Methods for features exploration = #author : Shashi Narayan, shashi.narayan(at){ed.ac.uk,loria.fr,gmail.com})= #date ...
""" The :py:mod:`.io` module provides functions which can be used to parse external data formats used by Psephology. """ def parse_result_line(line): """Take a line consisting of a constituency name and vote count, party id pairs all separated by commas and return the constituency name and a list of resul...
n = int(input()) while(n > 0): n -= 1 a, b = input().split() if(len(a) < len(b)): print('nao encaixa') else: if(a[len(a)-len(b)::] == b): print('encaixa') else: print('nao encaixa')
#1) Multiples of 3 and 5 #If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. #Find the sum of all the multiples of 3 or 5 below 1000. # Solution A def multiples(n): num = 1 while num < n: if num % 3 == 0 or num % 5 == 0: ...
""" Advent of Code, 2020: Day 07, a """ with open(__file__[:-5] + "_input") as f: inputs = [line.strip() for line in f] bags = dict() def search(bag): """ Recursively search bags """ if bag not in bags: return False return any(b == "shiny gold" or search(b) for b in bags[bag]) def run(): ...
class Kettle(object): def __init__(self, make, price): self.make = make self.price = price self.on = False kenwood = Kettle("kenwood", 8.99) print(kenwood.make) print(kenwood.price) kenwood.price = 12.75 print(kenwood.price) hamilton = Kettle("hamilton", 14.00) print(hamilton.price)
#!/usr/bin/env python # -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology. # SPDX-FileCopyrightText: © 2021 Lee McCuller <mcculler@mit.edu> # NOTICE: authors should document their contributions in concisely in NOTICE # with details inline ...
# Font: https://realpython.com/python-recursion/ #Traverse a Nested List Recursively names = [ "Adam", [ "Bob", [ "Chet", "Cat", ], "Barb", "Bert" ], "Alex", [ "Bea", "Bill" ], "Ann" ] print(len(names)) for i...
# # CodeFragment # | # +-- Ann # | | # | +-- LeaderAnn # | +-- TrailerAnn # | # +-- NonAnn # | # +-- AnnCodeRegion # # ----------------------------------------- class CodeFragment: def __init__(self): """Instantiate a code fragment""" self.id = "None" pass # ---------...
HAND1 = """ Full Tilt Poker Game #33286946295: MiniFTOPS Main Event (255707037), Table 179 - NL Hold'em - 10/20 - 19:26:50 CET - 2013/09/22 [13:26:50 ET - 2013/09/22] Seat 1: Popp1987 (13,587) Seat 2: Luckytobgood (10,110) Seat 3: FatalRevange (9,970) Seat 4: IgaziFerfi (10,000) Seat 5: egis25 (6,873) Seat 6: gamblie (...
# Calculate paycheck xh = input("Enter Hors: ") xr = input("Enter Rate: ") xp = float(xh) * float(xr) print("Pay:", xp)
class Deneme: def __init__(self,limit): self.limit = limit def __iter__(self): self.a = 5 return self def __next__(self): a = self.a if a > self.limit: raise StopIteration self.a = a + 1 return a for i in Deneme(20): print(i) m...
input_s = ['3[abc]4[ab]c', '2[3[a]b]c'] # if '[' not in comp[l+1:r]: # return int(comp[0:l]) * comp[l+1:r] a = '10[a]b' b = '2[2[3[a]b]c]' c = '3[abc]4[ab]c' def findnth(haystack, needle, n): parts= haystack.split(needle, n+1) if len(parts)<=n+1: return -1 return len(haystack)-len(parts[-...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = '' __author__ = 'shen.bas' __time__ = '2018-02-03' """
# You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. # # Return the max sliding window. # #   # Example 1: # # # Input: num...
class CodegenError(Exception): pass class NoOperationProvidedError(CodegenError): pass class NoOperationNameProvidedError(CodegenError): pass class MultipleOperationsProvidedError(CodegenError): pass
# coding: utf-8 class Item(object): def __init__(self, name, price, description, image_url, major, minor, priority): self.name = name self.price = price self.description = description self.image_url = image_url self.minor = minor self.major = major self.prior...
# class and object (oops concept) class class_8: print() name = 'amar' # class class_9: # name = 'rahul' # age = 23 # def welcome(self): # print("welcome to teckat") # # a = class_9() # create object of class abc # # b = class_8() # # c = class_9() # # # print(abc.name) # accessi...
with open('iso_list/valid_list.txt') as i: names = i.readlines() with open('iso_list/valid.prediction') as i: p = i.readlines() out = open('iso_list/valid_prediction.txt', 'w') assert len(names) == len(p) for i, n in enumerate(names): n = n[:-1] result = n + ' ' + p[i] out.write(result)
# ''' # Linked List hash table key/value pair # ''' class LinkedPair: def __init__(self, key, value): self.key = key self.value = value self.next = None # ''' # Resizing hash table # ''' class HashTable: def __init__(self, capacity): self.capacity = capacity self.stor...
#coding: utf-8 length = int(input("정사각형의 크기를 입력하시오. ")) for i in range(length): for j in range(length): print("#",end=" ") print("")
class Solution: def plusOne(self, digits): i = len(digits) - 1 while i >= 0: if digits[i] == 9: digits[i] = 0 i = i - 1 else: digits[i] += 1 break if i == -1 and digits[0] == 0: digits.append(...
class A: name="Default" def __init__(self, n = None): self.name = n print(self.name) def m(self): print("m of A called") class B(A): # def m(self): # print("m of B called") pass class C(A): def m(self): print("m of C called") class D(B, C): def __init__(self): self.objB =...
""" Copyright (c) 2015 Frank Lamar 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, distribute, s...
# Importação de bibiotecas # Título do programa print('\033[1;34;40mMENU DE OPÇÕES\033[m') # Objetos menu = 0 n1 = 0 n2 = 0 maior = 0 # Lógica while menu != 5: if n1 == n2 == 0: n1 = int(input('\033[30mDigite o primeiro número:\033[m ')) n2 = int(input('\033[30mDigite o segundo número:\033[m '))...
''' Created on 1.12.2016 @author: Darren '''''' Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the following matrix: [ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ] ] " '''
command = '/usr/bin/gunicorn' pythonpath = '/opt/netbox/netbox' bind = '0.0.0.0:{{ .Values.service.internalPort }}' workers = 3 errorlog = '-' accesslog = '-' capture_output = False loglevel = 'debug'
if __name__ == '__main__': n, x = map(int, input().split()) sheet = [] [sheet.append(map(float, input().split())) for i in range(x)] for i in zip(*sheet): print(sum(i)/len(i))
# 公众号:MarkerJava # 开发时间:2020/10/6 01:21 # 字符串替换操作 a = 'Python,JAVA,C++,C++' print(a.replace('Python', 'c++', 2)) # 字符串的合并操作 lst = ['python', 'java', 'c++', 'c'] pr = '|'.join(lst) print(pr)
class ListaProduto(object): lista_produtos = [ { "id":1, "nome":"pao sete graos" }, { "id":2, "nome":"pao original" }, { "id":3, "nome":"pao integral" }, { "id":4, ...
#6. Реализовать функцию int_func(), принимающую слово из маленьких латинских букв и возвращающую его же, но с прописной первой буквой. Например, print(int_func(‘text’)) -> Text. # Продолжить работу над заданием. В программу должна попадать строка из слов, разделенных пробелом. Каждое слово состоит из латинских букв ...
# -*- coding: utf-8 -*- """ Created on Sat Apr 24 19:59:10 2021 @author: sshir """ def rec(df, item_col, user_col, user, user_rating_col, avg_rating_col, sep=None): ''' Recommending items for a specific existing user based on user rating and average rating per item. Returns only the items which...
valor = int(input("Valor da casa: R$ ")) sal = int(input("Salário do comprador: R$ ")) ano = int(input("Quantos anos de financiamento? ")) prest = valor / (ano*12) print(f'Para pagar uma casa de R$ {valor} em {ano} anos a prestação será de R$ {prest:.2f}') if prest > sal*0.3: print('Empréstimo {}NEGADO{}'.format...
apiAttachAvailable = u'\u0648\u0627\u062c\u0647\u0629 \u0628\u0631\u0645\u062c\u0629 \u0627\u0644\u062a\u0637\u0628\u064a\u0642 (API) \u0645\u062a\u0627\u062d\u0629' apiAttachNotAvailable = u'\u063a\u064a\u0631 \u0645\u062a\u0627\u062d' apiAttachPendingAuthorization = u'\u062a\u0639\u0644\u064a\u0642 \u0627\u0644\u06...
def go(): with open('input.txt', 'r') as f: ids = [item for item in f.read().split('\n') if item] for i in range(len(ids)): for j in range(i + 1, len(ids)): diff_count = 0 for k in range(len(ids[i])): if ids[i][k] != ids[j][k]: ...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class PyNvidiaMlPy(PythonPackage): """Python Bindings for the NVIDIA Management Library.""" homepage = "https://...
# -*- coding: utf-8 -*- def main(): abcd = sorted([int(input()) for _ in range(4)]) ef = sorted([int(input()) for _ in range(2)]) print(sum(abcd[1:] + ef[1:])) if __name__ == '__main__': main()
# This sample tests a series of nested loops containing variables # with significant dependencies. for val1 in range(10): cnt1 = 4 for val2 in range(10 - val1): cnt2 = 4 if val2 == val1: cnt2 -= 1 for val3 in range(10 - val1 - val2): cnt3 = 4 if val3 ...
# https://app.codesignal.com/arcade/intro/level-2/bq2XnSr5kbHqpHGJC def makeArrayConsecutive2(statues): statues = sorted(statues) res = 0 # Make elements of the array be consecutive. If there's a # gap between two statues heights', then figure out how # many extra statues have to be added so that al...
# https://leetcode.com/problems/count-of-matches-in-tournament/ """ Problem Description You are given an integer n, the number of teams in a tournament that has strange rules: If the current number of teams is even, each team gets paired with another team. A total of n / 2 matches are played, and n / 2 teams advance...
#28/07/2020 #Primeiro Repositório #GitHub/VisualStudio print('Testando Repositório 01')
subdomain = 'srcc' api_version = 'v1' callback_url = 'http://localhost:4567/'
# Take the values C = int(input()) A = int(input()) # calculate student trips quociente = A // (C - 1) # how many students are letf resto = A % (C - 1) # if there is a student left, you have +1 trip if resto > 0: quociente += 1 # Shows the value print(quociente)
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
class BaseCreation(object): """ This class encapsulates all backend-specific differences that pertain to database *creation*, such as the column types to use for particular Django Fields. """ pass
class TechnicalSpecs(object): def __init__(self): self.__negative_format = None self.__cinematographic_process = None self.__link = None @property def negative_format(self): return self.__negative_format @negative_format.setter def negative_format(self, negative_for...
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 load("//bazel_tools:versions.bzl", "version_to_name") def _build_dar( name, package_name, srcs, data_dependencies, sdk_version): daml = "@...
# package marker. __version__ = "1.1b3" __date__ = "Nov 23, 2017"
S=list(input()) S.reverse() N=len(S) R=[0]*N R10=[0]*N m=2019 K=0 R10[0]=1 R[0]=int(S[0])%m for i in range(1,N): R10[i]=(R10[i-1]*10)%m R[i]=(R[i-1]+int(S[i])*R10[i])%m d={} for i in range(2019): d[i]=0 for i in range(N): d[R[i]]+=1 ans=0 for i in range(2019): if i == 0: ans += d[i] ...
# -*- coding: utf-8 -*- # Scrapy settings for dingdian project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/lates...
# -*- coding: utf-8 -*- """ Created on Sat Apr 1 18:05:45 2017 @author: Jonas <unifor@jonasluz.com> """ def linearSearch(data:list, item): """ Algoritmo de busca linear. """ for k, v in enumerate(data): if v == item: return(k) return(-1) # não encontrado. ## TESTES #...
class Solution(object): def maxProduct(self, nums): """ :type nums: List[int] :rtype: int """ # Runtime: 40 ms # Memory: 13.5 MB max_ = -1 second_max = -1 for num in nums: if num > max_: max_, second_max = num, max_ ...
# coding=utf-8 config_templates = { 'main': '', 'jails': 'enable = true\n', 'actions': """ # Fail2Ban configuration file # # Author: # # [Definition] # Option: actionstart # Notes.: command executed once at the start of Fail2Ban. # Values: CMD # actionstart = # Option: actionstop # Notes.: command...
# The MIT License (MIT) # # Copyright (c) 2017 Paul Sokolovsky # Modified by Brent Rubell for Adafruit Industries, 2019 # # 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, ...
""" Copyright (c) 2022 Adam Lisichin, Hubert Decyusz, Wojciech Nowicki, Gustaw Daczkowski 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 righ...
# this works, but has the argument order dependency problem class Rectangle: def __init__(self, width, height): self.height = height self.width = width def area(self): return self.height * self.width def perimeter(self): return (2 * self.height) + (2 * self.width) x = Rectangle(4, 4) print(x.wi...
""" Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right child. Example 1: Input: [5,3,6,2,4,null,8,1,null,null,null,7,9] 5 / \ 3 6 / \ \ 2 4 8 / / \ 1 7 9 Ou...
#143 # Time: O(n) # Space: O(1) # Given a singly linked list L: L0→L1→…→Ln-1→Ln, # reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… # # You must do this in-place without altering the nodes' values. # # For example, # Given {1,2,3,4}, reorder it to {1,4,2,3}. class ListNode(): def __init__(self,val): self.val=...
""" ┌─┐┌─┐┬ ┌┬┐┌─┐┬─┐┌─┐┬ ┌─┐┬ ┬ ┌┐ ┬ ┬ ┬ ┬┬ ┬┬─┐┬ ┌─┐┌┐┌┬┌─┌─┐ ├┤ │ ││ ││├┤ ├┬┘├─┘│ ├─┤└┬┘ ├┴┐└┬┘ ├─┤│ │├┬┘│ ├┤ │││├┴┐│ │ └ └─┘┴─┘─┴┘└─┘┴└─┴ ┴─┘┴ ┴ ┴ └─┘ ┴ ┴ ┴└─┘┴└─┴─┘└─┘┘└┘┴ ┴└─┘ """ __title__ = "folderplay" __description__ = "Remember watched tv episodes, resume from where you left off" __url__ ...
# -*- coding: utf-8 -*- # -------------------------------------- # tree_from_shot.py # # MDSplus Python project # for CTH data access # # tree_from_shot --- returns the CTH MDSplus tree associated with the # given shot number # # Parameters: # shotnum - integer - the shotnumber to open # Returns: #...
class TreeNode(object): def __init__(self,x): """ :type val: int :type left: TreeNode or None :type right: TreeNode or None """ self.val = x #設定當前值為x self.left = None #初始當前值左右沒有節點 self.right = None class Solution(object): ...
k,n=map(int,input().split());a=[int(i+1) for i in range(k)] for _ in range(n): s,e,m=map(int,input().split()) b0=a[:s-1];b1=a[s-1:e];b2=a[e:];a=[] l=b1[:m-s];r=b1[m-s:];b1=r+l a=b0+b1+b2 r="" for i in a: r+=str(i)+' ' print(r)
__author__ = 'Masataka' class IFileParser: def __init__(self): pass def getparam(self): pass def getJob(self): pass
# -*- encoding: utf-8 def func(x, y): return x + y def test_example(): assert func(1, 2) == 3
#!/usr/bin/env python class EnogList(): """ Object that stores the orthologous groups and their weights (if applicable) """ def __init__(self, enog_list, enog_dict): """ at initialization, the "EnogList" sorts the information that is required later. i.e. the dictionary of weights ...
#!/usr/bin/python # -*- coding: utf-8 -*- ### # MIT License # # Copyright (c) 2021 Yi-Sheng, Kang (Eason Kang) # # 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, ...
# -*- coding=utf-8 -*- class MessageInfo: def __init__(self, msgFlag, msgBody): self.msgFlag = msgFlag self.msgReServe = 0 msgBody = msgBody.encode(encoding='utf-8') # msgBody = bytes(msgBody, encoding='utf-8') self.msgBodySize = msgBody.__len__() self.msgBo...
"""Role testing files using testinfra""" def test_login_user(host): """Check login user""" g = host.group("berry") assert g.exists u = host.user("rasp") assert u.exists assert u.group == "berry" f = host.file("/home/rasp/.ssh/authorized_keys") assert f.is_file public_key = "ssh-...
"""This module implements Zaim CSV format.""" # Reason: Guarding for the future when it comes to calculating constants # pylint: disable=too-few-public-methods class ZaimCsvFormat: """This class implements Zaim CSV format.""" HEADER = [ "日付", "方法", "カテゴリ", "カテゴリの内訳", "...
guest_list = ["Shantopriyo Bhowmick", "Jordan B Peterson", "Mayuri B Upadhaya", "Deblina Bhowmick", "Sandeep Goswami", "Soumen Goswami"] print(f"Hi my dear brother{guest_list[0].title()}, Hope your killing it wherever you are. Come join me for a dinner. Meet people i like the most") print(f"Hi professor {guest_list[1...
class Participation: def __init__(self, id, tournament_id, player_id): self.id = id self.tournament_id = tournament_id self.player_id = player_id @staticmethod def build(attributes): return Participation( id=attributes['id'], tournament_id=attributes[...
def sumNums(n: int) -> int: return sum(range(1, n + 1)) def sumNums(n: int) -> int: # python的and操作如果最后结果为真,返回最后一个表达式的值,or操作如果结果为真,返回第一个结果为真的表达式的值 return n and n + sumNums(n - 1)
class NoisePageMetadata(object): """ This class is the model of the NoisePage metadata as it is represented by the HTTP API """ def __init__(self, db_version): self.db_version = db_version
""" pbs package """ __all__ = ["main", "build", "lookup"]
## ## Some global settings constants ## # The amount of inactivity (in milliseconds) that must elapse # before the badge will consider going into standby. If set to # zero then the badge will never attempt to sleep. sleeptimeout = 900000 # The default banner message to print in the scroll.py animation. banner = "DEFC...
class IncentivizeLearningRate: """ Environment which incentivizes the agent to act as if learning_rate=1. Whenever the agent takes an action, the environment determines: would the agent take the same action if the agent had been identically trained except with learning_rate=1? If so, give the agent ...
expres = str(input('digite uma expressão: ')) p = [] for s in expres: if s == '(': p.append('(') elif s == ')': if len(p) > 0: p.pop() else: p.append(')') break if len(p) == 0: print('expressão valida!!') else: print('expressão invalida!!')
# Set collector mode `raw` or `unpack` mode = 'raw' # LIsten IP address. ip_address = '127.0.0.1' # Listen port (UDP). port = 2055 # Template size in bytes. Template size configured on exporter. template_size_in_bytes = 50 # Capture duration in seconds caption_duration = 300
example_readings = [3,4,3,1,2] readings = [2,1,1,4,4,1,3,4,2,4,2,1,1,4,3,5,1,1,5,1,1,5,4,5,4,1,5,1,3,1,4,2,3,2,1,2,5,5,2,3,1,2,3,3,1,4,3,1,1,1,1,5,2,1,1,1,5,3,3,2,1,4,1,1,1,3,1,1,5,5,1,4,4,4,4,5,1,5,1,1,5,5,2,2,5,4,1,5,4,1,4,1,1,1,1,5,3,2,4,1,1,1,4,4,1,2,1,1,5,2,1,1,1,4,4,4,4,3,3,1,1,5,1,5,2,1,4,1,2,4,4,4,4,2,2,2,4,4,4...
class Events: TRAINING_START = "TRAINING_START" EPOCH_START = "EPOCH_START" BATCH_START = "BATCH_START" FORWARD = "FORWARD" BACKWARD = "BACKWARD" BATCH_END = "BATCH_END" VALIDATE = "VALIDATE" EPOCH_END = "EPOCH_END" TRAINING_END = "TRAINING_END" ERROR = "ERROR"
# 1.07 # Slicing and dicing #Selecting single values from a list is just one part of the story. It's also possible to slice your list, which means selecting multiple elements from your list. Use the following syntax: #my_list[start:end] #The start index will be included, while the end index is not. #The code sample b...
class Node: def __init__(self, val, parent, level=0): self.val = val self.parent = None self.level = level class Tree: def __init__(self, root): self.root = Node(root, None) self.root.level = 0 def find_hits(self, dist, clubs): c = self.root q = [...
# Source : https://leetcode.com/problems/merge-sorted-array/ # Author : foxfromworld # Date : 12/10/2021 # Second attempt class Solution: def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None: """ Do not return anything, modify nums1 in-place instead. """ p1, ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Margins in Sales Orders', 'version':'1.0', 'category': 'Sales/Sales', 'description': """ This module adds the 'Margin' on sales order. ============================================= This gives ...
a = int(input()) s = [x for x in input().split()] output = [] for i in range(a-1): if i == 0: if s[0] == '1': output.append('x^%d' % (a-i)) elif s[0] == '-1': output.append('-x^%d' % (a-i)) else: output.append(s[0]+'x^%d' % (a-i)) else: if int(...