content
stringlengths
7
1.05M
# -*- coding:utf-8 -*- """ @author: leonardo @created time: 2020-11-03 @last modified time:2020-11-03 """ def select(engine, backtesting_id): """ :param engine: :param backtesting_id: :return: """ sql = 'SELECT * from strategy_backtesting where backtesting_id="{}"'.format(backtesting_id) ...
if type(Query.target) is IfStatement: parent = Query.target.parent parent.beginModification('If to while') condition = Query.target.condition thenBranch = Query.target.thenBranch Query.target.replaceChild(condition, Node.createNewNode('Expression', None)) Query.target.replaceChild(thenBranch, Node.createNewNode...
# -*- coding:utf-8 -*- class CocoException(Exception): pass class CoCoRuntimeError(RuntimeError): pass
#!/usr/bin/env python3 def exam_grade(score): """Students in a class receive their grades as Pass/Fail. Scores of 60 or more (out of 100) mean that the grade is "Pass". For lower scores, the grade is "Fail". In addition, scores above 95 (not included) are graded as "Top Score". This function receives the score and...
sampleJson = { "id": 3, "pin": "700014", "cgst": 3241.53, "date": "2021-04-16", "igst": 0, "name": "Subhajit Paul", "sgst": 3241.53, "type": "S", "email": 'nulestu@gmail.com', "gstin": 'KKHUU654343KL8', "phone": 9165799976, "mobile": "7059403006", "ref_no": "GKUS/30/2...
def dot(data, compile_to=None): notation_list = data.split('.') compiling = "" compiling += notation_list[0] beginning_string = compile_to.split('{1}')[0] compiling = beginning_string + compiling dot_split = compile_to.replace(beginning_string + '{1}', '').split('{.}') if any(len(x) > 1 for...
''' File này gồm 2 hàm kiểm tra tọa độ trước khi gửi qua serial ''' # kiểm tra tọa độ có hợp lệ không def plc1CoordinateValidator(raw_x, raw_y, raw_z): #y = int(raw_y)-59-21, -59 (mép ngoài) là khoảng cách từ camera đến khung, 21 từ khung đến trục thân xilanh trục y #231 khoảng cách hai mép trong, 59 từ cam đến...
"""Functions relating to grokking_algorithms qucksort chapter.""" def euclid_algorithm(area): """Return the largest square to subdivide area by.""" height = area[0] width = area[1] maxdim = max(height, width) mindim = min(height, width) remainder = maxdim % mindim if remainder == 0: ...
expected_output = { "tag": { "test": { "system_id": { "R2_xr": { "type": { "L1L2": { "area_address": ["49.0001"], "circuit_id": "R1_xe.01", "format": "P...
class CliArgs(object): def __init__(self): self.search = [] self.all = False self.slim = False self.include = False self.order = False self.reverse = False self.json = False self.version = False
# -*- coding: utf-8 -*- class DataNameBuilder(object): """ data_name等拼接工具 """ def __init__(self, data_name, bk_biz_id, data_name_prefix): self.data_name = data_name self.bk_biz_id = bk_biz_id self.data_name_prefix = data_name_prefix @property def name(self): r...
# 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. # https://projecteuler.net/problem=1 # 1, 5, 10, 15, 20, ... # 3, 6, 9, 12, 15, 18, 21, ... limit = 1000 print( sum( set(range(...
def circ_supply(height: int, nano: bool = False) -> int: """ Circulating supply at given height, in ERG (or nanoERG). """ # Emission settings initial_rate = 75 fixed_rate_blocks = 525600 - 1 epoch_length = 64800 step = 3 # At current height completed_epochs = max(0, h...
# Resources for an MPMCT with n controls def mpmct_depth(n): return 28*n - 60 def mpmct_t_c(n): return 12*n - 20 def mpmct_t_d(n): return 4*(n-2) def mpmct_h_c(n): return 4*n - 6 def mpmct_cnot_c(n): return 24*n - 40
class Equip(): def __init__(self, name, attribute, action): self.name = name self.attribute = attribute self.action = action class Item(): def __init__(self, name, attribute, buff): self.name = name self.attribute = attribute self.buff = buff class Attribute(dic...
class ProxyException(Exception): """Proxy returned an error.""" def __init__(self, message='Proxy returned an error.'): # Call the base class constructor with the parameters it needs super(ProxyException, self).__init__(message)
H, W, N = map(int, input().split()) berry = [tuple(int(x) for x in input().split()) for _ in range(N)] ans = [] for i in range(1, W+1): up = 0 for x, y in berry: if i * y == H * x: break elif i * y > H * x: up += 1 else: if up * 2 == N: ans.append(...
__author__ = 'lg' a = raw_input() if a > 0: print('positive number') elif a < 0: print('negative number') else: print('the number is zero')
# Advent of Code - Day 7 - Part One def parse(input): return [int(n) for n in input[0].split(",")] def result(input): positions = parse(input) fuel_cost_options = [] for i in range(min(positions), max(positions) + 1): movements = [abs(n - i) for n in positions] fuel_cost_options.appe...
''' 6. Write a Python program to create a histogram from a given list of integers. ''' def histogram(values): for n in values: output = '' x = n while(x > 0): output += '*' x = x - 1 print(output) histogram([1,2,3,4,5,6])
print("#######################################") print("## AVERAGE STUDENT HEIGHT CALCULATOR ##") print("#######################################") #test heights: 123 149 175 183 166 179 125 student_heights = input(" Input a list of student heights:\n>> ").split() for n in range(0, len(student_heights)): student_hei...
i = 1 while True: print(i) i += 1 if i > 10: break
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) c = (a, b) d = {e: 1, f: 2} fun(a, b, *c, **d) # EXPECTED: [ ..., BUILD_TUPLE(2), ..., BUILD_TUPLE_UNPACK_WITH_CALL(2), ..., CALL_FUNCTION_EX(1), ..., ]
#A program that counts the number of characters up to the first $ in a text file. file = open("poem.txt","r") data = file.readlines() for index in range(len(data)): for secondIndex in range(len(data[index])): if data[index][secondIndex] == "$": break print( "Total number of chara...
def metade(valor = 0, format = False): resp = valor/2 return resp if format is False else money(resp) def dobro(valor = 0, format = False): resp = valor*2 return resp if format is False else money(resp) def dez_porcento(valor = 0, format = False): resp = valor + (valor*10)/100 return resp i...
''' Created on 2020-04-15 14:50:02 Last modified on 2020-05-07 21:21:10 Python 2.7.16 v0.1 @author: L. F. Pereira (lfpereira@fe.up.pt) Main goal --------- Develop functions to get data from odb files. ''' #%% history outputs def get_xydata_from_nodes_history_output(odb, nodes, variable, ...
P = {} # Imputers P['mean imp'] = {'strategy': 'mean'} P['median imp'] = {'strategy': 'median'} P['most freq imp'] = {'strategy': 'most_frequent'} P['constant imp'] = {'strategy': 'constant'} P['iterative imp'] = {'initial_strategy': 'mean', 'skip_complete': True}
#23212 | Contract with Mastema isDS = chr.getJob() == 3100 sm.setSpeakerID(2450017) if not sm.canHold(1142342): sm.sendSayOkay("Please make space in your equip inventory.") sm.dispose() if sm.sendAskYesNo("Everything is ready. Let us begin the contract ritual. Focus on your mind."): sm.jobAdvance(isDS a...
#prob:lem statement: Make the below pattern. Here, n =4 #4 4 4 4 4 4 4 #4 3 3 3 3 3 4 #4 3 2 2 2 3 4 #4 3 2 1 2 3 4 #4 3 2 2 2 3 4 #4 3 3 3 3 3 4 #4 4 4 4 4 4 4 n=int(input("enter any number: ")) #n is the number for the outermost lines and val is the value to be printed in row i column j #for first left quadrant for i...
# train-project/train_schedule/views/formatters.py """Helper functions to format data for display.""" def format_station(station, show_id=False): """Format station data for display""" if station is None: return "Unknown" else: fmt_str = "{city}, {country} ({code})" if show_id: ...
def index_settings(table_name): """ Return the Elasticsearch mapping for a given table in the database. :param table_name: The name of the table in the upstream database. :return: """ settings = { "index": { "number_of_shards": 18, "number_of_replicas": 0, ...
class IntegralCalculator: def __init__(self): self.value = 0 self.last_time = 0 def get_current_integral(self) -> float: return self.value def get_and_update_integral(self, new_x, new_time) -> float: self.update_integral(new_x, new_time) return self.get_current_inte...
DEBUG = True TEMPLATE_DEBUG = DEBUG # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts ALLOWED_HOSTS = [] ADMINS = ( ('Joe Admin', 'joe@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'EN...
n1 = int(input("Digite n1: ")) n2 = int(input("Digite n2: ")) if (n2 == 0): print("Não é possível dividir por zero.") if (n1 % 3 == 0 and n1 % 5 == 0): print("O número n1 = {} é divisível por 3 e 5.".format(n1)) else: print("O número n1 = {} não é divisível por 3 e 5 ao mesmo tempo".format(n1)) if (n2 % ...
def countApplesAndOranges(s, t, a, b, apples, oranges): # Write your code here fallen_apples = 0 fallen_oranges = 0 for apple in apples: if a + apple >= s and a + apple <= t: fallen_apples += 1 for orange in oranges: if b + orange >= s and b + orange <= t: f...
# Create a set and check if element already exists. class Solution: def containsDuplicate(self, nums: List[int]) -> bool: return len(nums) != len(set(nums))
content = ''' <h1>{{title}}</h1> <p>所有用例:{{all_case_sum}}</p> <p>成功用例:{{success_case_sum}}</p> <p>失败用例:{{errors_case_sum}}</p> <p>跳过用例:{{skipped_case_sum}}</p> <p><a href="{{report_path}}">报告</a></p> ''' def get_maile_html_tpl(): return content if __name__ == '__main__': print(get_maile_html_tpl())
i = 2 while True: if i % 3 == 0: break print(i) i += 2
vector_collection = { 'none': None, 'empty': [], 'numerals': [1, 1, 2, 3, 5, 8, 13, 21], 'strings': ['foo', 'bar', 'zen'], 'cities': ['san fransisco', 'buenos aires', 'bern', 'kinshasa-brazzaville', 'nairobi'] }
# -*- coding: utf-8 -*- DESC = "aai-2018-05-22" INFO = { "SimultaneousInterpreting": { "params": [ { "name": "ProjectId", "desc": "腾讯云项目 ID,可填 0,总长度不超过 1024 字节。" }, { "name": "SubServiceType", "desc": "子服务类型。0:离线语音识别。1:实时流式识别,2,一句话识别。3:同传。" }, { ...
class Solution: def moveZeroes(self, nums): """ :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """ l=nums j=0 for i in range(len(l)): if l[i]!=0: nums[j]=l[i] j+=1 fo...
# Dev: Miguel Rovira-Gonzalez # Date: 2/11/2020 # Homework: codingbat make bricks python problem, https://codingbat.com/prob/p118406 # Problem to solve: #---------------------------------------------------------------------------------------- # We want to make a row of bricks that is goal inches long. # We have a numbe...
# list in python and follow indexing rule, start from 0 thisList = ["pooya","mohammad","Mahdi","Alireza"] print(thisList) thisList[1] = "Eshghe Man" print(thisList) # The list() constructor include add item to list and delete the item listTwo = list(("apple","melon","orange")) print(listTwo) # append() use to add ...
''' Key points: - recognize that this is very similar to merging intervals (https://leetcode.com/problems/merge-intervals/description/) - it doesn't matter which employee an interval belongs to, so just flatten - can build result array while merging, don't have to do afterward (and don't need full merged arr) ''' def...
""" Crie um programa que solicita vários números inteiros ao usuário, pergunte se ele quer continuar digitando e caso responda não, informe o total de números digitados, o menor, o maior e a média entre eles. """ total = soma = maior = 0 menor = 9999999999999999 resposta = 'S' while resposta in 'S': num = int(inp...
#!/usr/bin/python # -*- coding: utf-8 -*- # Дано натуральное число n. Выведите все числа от 1 до n. Без использования циклов. def print_and_decr(i: int) -> int: print("%d\n", i) i -= 1 if i > 1: print_and_decr(i) print_and_decr(821)
ligne_vide = ['o','o','o','o','o','o','o','o','o'] ligne_courte = ['o','o','.','.','.','.','.','o','o'] ligne_longue = ['o','.','.','.','.','.','.','.','o'] arche_vide = [ligne_vide,ligne_courte,ligne_longue,ligne_longue,ligne_courte,ligne_vide] #print(arche_vide) def affiche_ligne (l) : s='' for c i...
class TalkMessage: def __init__(self, messageId, timeStamp, body, senderAvatarId, senderAvatarName, senderAccountId, senderAccountName, receiverAvatarId, receiverAvatarName, receiverAccountId, receiverAccountName, talkType, extraInfo=None): self.timeStamp = timeStamp self.body = body self...
''' While Loops Used to execute a set of statements(code) continuously as long as a condition is True. The while loop needs to be setup in a way that as long as a condition is True, Then stop when the condition becomes False. While loop can have optional else clause. ''' i = 1
def get_f(f, i, mode): try: if mode == 0: return f[f[i]] if mode == 1: return f[i] except KeyError: return 0 raise NotImplementedError def set_f(f, value, i, mode): if mode == 0: f[f[i]] = value return if mode == 1: f[i] = val...
""" Provides hard-coded values used in this package. No imports are allowed since many other modules import this one """ __copyright__ = "Copyright 2020, Datera, Inc." VERSION = "1.2.26" VERSION_HISTORY = """ Version History: 1.1.0 -- Initial Version 1.1.1 -- Metadata Endpoint, Pep8 cleanup, Logging revamp ...
USER = "__DUMMY_TRANSFORMERS_USER__" FULL_NAME = "Dummy User" PASS = "__DUMMY_TRANSFORMERS_PASS__" # Not critical, only usable on the sandboxed CI instance. TOKEN = "hf_94wBhPGp6KrrTH3KDchhKpRxZwd6dmHWLL" ENDPOINT_PRODUCTION = "https://huggingface.co" ENDPOINT_STAGING = "https://hub-ci.huggingface.co" ENDPOINT_STAGIN...
print("copy content from auto created ex23_sample_05.txt to ex23_sample_06.txt using 1 line only") input('In powershell: echo "This is a unicode Test." > ex23_sample_05.txt ') in_file = open('c:\\users\\roy\\ex23_sample_05.txt', encoding = 'utf-16').read() out_file = open('c:\\users\\roy\\ex23_sample_06.txt', 'w', enc...
sum = 0 count = 0 while True: try: name = input() distance = int(input()) sum += distance count += 1 except EOFError: break print("{:.1f}".format(sum/count))
# -*- coding: utf-8 -*- #from scrapy.settings.default_settings import DOWNLOAD_DELAY #from scrapy.settings.default_settings import ITEM_PIPELINES # Scrapy settings for fbo_scraper project # # For simplicity, this file contains only the most important settings by # default. All the other settings are documented here: #...
#Factorial de un numero, usar recursividad. def factorial(number): if number == 0: return 1 return number * factorial(number - 1) if __name__ == '__main__': number = int(input('Ingrese numero a convertir en factorial: ')) result = factorial(number) print('El resultado es:...
""" Given the root of a binary search 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 one right child.   Example 1: Input: root = [5,3,6,2,4,null,8,1,null,null,null,7,9] Output: [1,null,2,null,3,null,4,null,5,null,6,n...
class Student: def __init__(self, name, school): self.name = name self.school = school self.marks = [] def average(self): return sum(self.marks) / len(self.marks) def go_to_school(self): return "I'm going to {}".format(self.school) anna = Student("Anna", "Oxford")...
"""Top-level package for fdf.""" __author__ = """Ledenel Intelli""" __email__ = 'ledenelintelli@gmail.com' __version__ = '0.1.9'
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Andy Wilson, Michael Darling, David Stracuzzi, Shelley Leger Sandia National Laboratories February 25, 2020 Defines set of test sudoku problems to use to test the sudoku infrastructure """ puzzles = { 'test2-i24e40': '30000070000000100000006000000070001540030000...
# Part 2 on day 2 on advent of code # # Tyler Stuessi def get_bathroom_code(): # get input code = "" keypaths = [] try: while True: raw = input() keypaths.append(raw) except EOFError: pass # hard code the grid grid = [["0", "0", "1", "0", "0"], ...
def fizz_buzz(input): result = [] for x in range(1, input + 1): value = '' if x % 3 == 0: value += 'Fizz' if x % 5 == 0: value += 'Buzz' value = value or x result.append(value) return result
# This sample tests annotated types on global variables. # This should generate an error because the declared # type below does not match the assigned type. glob_var1 = 4 # This should generate an error because the declared # type doesn't match the later declared type. glob_var1 = Exception() # type: str glob_var1 ...
""" Mock for the figures.permissions model. """ def is_active_staff_or_superuser(request): """ Exact copy of Figures=0.4.x `figures.permissions.is_active_staff_or_superuser` helper. """ return request.user and request.user.is_active and ( request.user.is_staff or request.user.is_superuser)
"""ssd_classes.py This file was modified from: http://github.com/AastaNV/TRT_object_detection/blob/master/coco.py """ COCO_CLASSES_LIST = [ 'background', # was 'unlabeled' 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light...
"""Write a HashTable class that stores strings in a hash table, where keys are calculated using the first two letters of the string.""" class HashTable(object): def __init__(self): self.table = [None] * 10000 def store(self, string): """Input a string that's stored in the table.""" ...
N = int(input()) for i in range(1, N): print(' ' * (N - i) + '*' * ((i * 2) - 1)) for i in range(N, 0, -1): print(' ' * (N - i) + '*' * ((i * 2) - 1))
#!/usr/bin/env python __all__ = [ "test_misc", "test_dictarray", "test_table", "test_transform", "test_recode_alignment", "test_union_dict", ] __author__ = "" __copyright__ = "Copyright 2007-2022, The Cogent Project" __credits__ = [ "Jeremy Widmann", "Sandra Smit", "Gavin Huttley", ...
class Config(object): DEBUG = False TESTING = False SECRET_KEY = "B\xb2?.\xdf\x9f\xa7m\xf8\x8a%,\xf7\xc4\xfa\x91" MONGO_URI="mongodb://localhost:27017/test" IMAGE_UPLOADS = "/home/username/projects/my_app/app/static/images/uploads" SESSION_COOKIE_SECURE = False class ProductionConfig(Config): ...
# Real part of spherical harmonic Y_(4,2)(theta,phi) def Y(l,m): def g(theta,phi): R = abs(fp.re(fp.spherharm(l,m,theta,phi))) x = R*fp.cos(phi)*fp.sin(theta) y = R*fp.sin(phi)*fp.sin(theta) z = R*fp.cos(theta) return [x,y,z] return g fp.splot(Y(4,2), [0,fp.pi], [0,2*fp....
number = int(input()) if number % 2 == 1 or 6 <= number <= 20: print('Weird') elif 2 <= number <= 5 or number > 20: print('Not Weird')
''' Exercise 5: Take the following Python code that stores a string: str = 'X-DSPAM-Confidence:0.8475' Use find and string slicing to extract the portion of the string\ after the colon character and then use the float function to convert the extracted string into a floating point number...
#$Id$ class Category: """This class is used to create object for category.""" def __init__(self): """Initialize parameters for Category.""" self.id = "" self.name = "" def set_id(self, id): """Set id. Args: id(str): Id. """ se...
class Song: def __init__(self, name, length, single): self.name = name self.length = length self.single = single def get_info(self): return f"{self.name} - {self.length}" #Test code # song = Song("Running in the 90s", 3.45, False) # print(song.get_info())
class MyCircularQueue: def __init__(self, k: int): self.q = [None] * k self.maxlen = k self.front = 0 self.rear = 0 def enQueue(self, value: int) -> bool: if self.q[self.rear] is None: self.q[self.rear] = value self.rear = (self.rear + 1...
load("//tools:defaults.bzl", "protractor_web_test_suite") """ Macro that can be used to define a e2e test in `modules/benchmarks`. Targets created through this macro differentiate from a "benchmark_test" as they will run on CI and do not run with `@angular/benchpress`. """ def e2e_test(name, server, **kwargs): ...
_base_ = [ '../_base_/models/lxmert/lxmert_pretrain_config.py', '../_base_/datasets/lxmert/lxmert_pretrain.py', '../_base_/default_runtime.py', ]
def print_all_binary_strings(n): helper(n, "") print("-------------------") def helper(n, s, lvl = 0): space = (" " * lvl) + s print(space) if(len(s) == n): print(s) else: helper(n, s + "0", lvl + 1) helper(n, s + "1", lvl + 1) print_all_binary_strings(1) print_all_binary_str...
# DEBUG FLAGS TRAIN_JUST_ONE_BATCH = False TRAIN_JUST_ONE_ROUND = False PROFILE = False CHECK_GRADS = False # Basic LEARNING_RATE_DEFAULT = 1e-2 # 0.01 MAX_EPOCHS_DEFAULT = 100 EVAL_FREQ_DEFAULT = 5 BATCH_SIZE_DEFAULT = 5 WORKERS_DEFAULT = 4 OPTIMIZER_DEFAULT = 'ADAM' WEIGHT_DECAY_DEFAULT = 0.01 DATA_DIR_DEFAULT ...
# The contents of this file has been derived code from the Twisted project # (http://twistedmatrix.com/). The original author is Jp Calderone. # Twisted project license follows: # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # ...
# debug DEBUG = False
'''1. Write a Python function that takes a sequence of numbers and determines whether all the numbers are different from each other.''' def unique(string): if len(string) == len(set(string)): ans = 'True' else: ans = 'False' return ans print(unique((1, 2, 3, 4))) print(unique((1, 3, 3, 4)...
# -*- coding: utf-8 -*- { '!langcode!': 'nl', '!langname!': 'Nederlands', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', '%(nrows)s rec...
#!/usr/bin/env python """ CREATED AT: 2021/8/1 Des: https://leetcode.com/contest/weekly-contest-252/problems/three-divisors/ GITHUB: https://github.com/Jiezhi/myleetcode """ class Solution: def isThree(self, n: int) -> bool: cnt = 0 for i in range(2, int(n / 2) + 1): if n % i == 0: ...
try: var1 += 1 except: var1 = 1 def __quick_unload_script(): print("Unloaded: %s" % str(var1)) print(f"Just edit and save! {var1}")
class MissingKeyError(Exception): pass class NoneError(Exception): pass
def print_lol(the_list, indent = False, level = 0): """This function ...""" for each_item in the_list: if isinstance(each_item, list): print_lol(each_item, indent, level + 1) else: if indent: for tab_stop in range(level): print("\t", e...
''' Tipo: Concepto, Ejercicio, Pregunta... Fuente: libro, curso, ... Este chunk de código tiene como propósito... '''
# Copyright 2018 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. """Enforces luci-milo.cfg consistency. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit API bui...
# A importancia de R$780.000.00 será dividida entre tres ganhadores de um concurso # sendo que da quantia total: # - O primeiro ganhador receberá 46% # - O segundo recebera 32% # - O terceiro receberá o restante premio = 780000.00 primeiro = premio * 0.46 segundo = premio * 0.32 terceiro = premio - primeiro - segundo...
#Also called as Circular Queue class Queue: def __init__(self, maxSize): self.items = maxSize * [None] # To initialize a list with a limit set make a list with the size u want and make all the elements None self.maxSize = maxSize self.start = -1 self.top = -1 def __str__(self)...
def checkorders(orders: [str]) -> [bool]: results = [] for i in orders: flag = True stock = [] for j in i: if j in '([{': stock.append(j) else: if stock == []: flag = False break ...
a = int(input()) b = int(input()) if a > b: print(a) else: print(b)
""" Zadeklaruj funkcje która jako argumenty przyjmuje dwie zmienne i zwraca ich sumę """ def f(a:int, b:int): return a+b print(f(12, 12))
""" Faça um Programa que peça a temperatura em graus Fahrenheit, transforme e mostre a temperatura em graus Celsius. C = 5 * ((F-32) / 9). """ farenheit = float(input('Informe a temperatura em Farenheit: ')) celsius = 5 * (farenheit - 32) / 9.0 print(f'A temperatura em Celsius é: {celsius}')
a,b = map(int,input().split()) ans=0 k=1 while a or b: ans+=k*(((b%3)-(a%3))%3) a//=3 b//=3 k*=3 print(ans)
# Minimum Remove to Make Valid Parentheses: https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/ # Given a string s of '(' , ')' and lowercase English characters. # Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is ...
#!user/bin/python class MyEnv: """ """ def __init__(self): self.my_env = { "subnet": "<your_lab_subnet/mask>", "gateway": "<your_lab_gateway_ip_address>", "ansible_addr": "<ansible_container_ip_address>", "web_addr": "<wev_container_ip_address>", ...
# -*- coding: utf-8 -*- """ @Author : captain @time : 18-7-11 上午12:33 @ide : PyCharm """ class DefaultConfig(object): ''' 列出所有的参数,只根据模型需要获取参数 ''' env = 'default' # visdom环境 seed = 777 # 设置随机数种子 best_score = 0 model = 'InCNN' # 使用的模型,名字必须与models/__init__.py中的名字一致 model_pat...
app_name = "users" urlpatterns = [ ]