content
stringlengths
7
1.05M
""" There are some spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y-coordinates don't matter, and hence the x-coordinates of start and end of the diameter suffice. The start is always smaller than t...
# 分身合球,分身吃球 server_default_config = dict( team_num=2, player_num_per_team=2, map_width=300, map_height=300, match_time=10, state_tick_per_second=10, # frame action_tick_per_second=5, # frame collision_detection_type='precision', save_video=False, save_quality='high', # ['high'...
def do(self): self.components.Open.label="Open" self.components.Delete.label="Delete" self.components.Duplicate.label="Duplicate" self.components.Run.label="Run" self.components.Files.text="Files" self.components.Call.label="Call"
#!/usr/bin/env python3 # Copyright 2019, Alex Wiens <awiens@mail.upb.de>, Achim Lösch <achim.loesch@upb.de> # SPDX-License-Identifier: BSD-2-Clause foo = {\ "heat":[256,512,1024,2048,4096,8192,16384],\ "correlation":[256,512,1024,2048,4096,8192,16384],\ "bfs":[128,256,512,1024,2048,4096,8192,16384],\ "markov":[12...
# 3rd question # 12 se 421 takkk k sare no. ka sum print kre. # akshra=12 # sum=0 # while akshra<=421: # sum=sum+akshra # print(s) # akshra=akshra+1 # 4th question # 30 se 420 se vo no. print kro jo 8 se devied ho # var=30 # while var<=420: # if var%8==0: # print(var) # ...
# Copyright (C) 2018 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Module contains Access Control Role names related to TaskGroupTask model.""" ASSIGNEE_NAME = "Task Assignees" SECONDARY_ASSIGNEE_NAME = "Task Secondary Assignees"
# Project Euler Problem 5 ###################################### # Find smallest pos number that is # evenly divisible by all numbers from # 1 to 20 ###################################### #essentially getting the lcm of several numbers # formula for lcm is lcm(a,b) = a*b / gcd(a,b) def gcd(a, b): assert type(a) i...
print('hello world') print("hello world") print("hello \nworld") print("hello \tworld") print('length=',len('hello')) # len returns the length of the string mystring="python" # assigning value python to variable mystring print(mystring) # it returns python # Indexing print('the element at Index[0]=',m...
# -*- coding: utf-8 -*- def main(): a, b = map(int, input().split()) if a + 0.5 - b > 0: print(1) else: print(0) if __name__ == '__main__': main()
''' Faça um algoritmo que leia o preço de um produto e mostre seu novo preço, com 5% de desconto. ''' preco = float(input('Digite o preço do produto: R$ ')) novoPreco = preco*0.95 print(f'O preço com 5% de desconto é R${novoPreco:.2f}')
# Дано предложение. Определить количество букв н, предшествующих первой запятой # предложения. Рассмотреть два случая: известно, что запятые в предложении есть; # запятых в предложении может не быть. #!/usr/bin/env python3 # -*- coding: utf-8 -*- if __name__ == '__main__': n = input("Предложение - ") ...
"""This file is imported in both train.py and predict.py to find the models path. """ # root directory to save models ## for running locally MODELS_DIR = "models" ## for remote deploy # MODELS_DIR = "/volumes/data"
values = input("Please fill value:") result = [] for value in values : if str(value).isdigit() : dec = int(value) if dec % 2 != 0 : result.append(dec) print(result) print(len(result))
class ClientException(Exception): """The base exception for everything to do with clients.""" message = None def __init__(self, status_code=None, message=None): self.status_code = status_code if not message: if self.message: message = self.message els...
n = [int,int]; resultado = 0; for i in range(len(n)): n[i] = int(input("Insira o N%i: " % int(i+1))) dsr = n[0]; dnd = n[1]; while dnd <= dsr: dsr -= dnd resultado += 1 print(str(n[0]) + " / " + str(n[1]) + " = " + str(resultado)) if dsr != 0: print(str(dsr) + " é o resto dessa operação.")
#Fácil 5- Faça um programa para a leitura de duas notas parciais de um aluno.A mensagem “Aprovado”, se a média alcançada for maior ou igual a sete;A mensagem “Aprovado com Distinção”, se a média for igual a dez;A mensagem “Reprovado” se a média for menor de do que sete; nome=input('Digite o nome do aluno: ') nota_1bi=...
class Instrument: def __init__(self, exchange_name, instmt_name, instmt_code, **param): self.exchange_name = exchange_name self.instmt_name = instmt_name self.instmt_code = instmt_code self.instmt_snapshot_table_name...
class NoProjectYaml(Exception): pass class NoDockerfile(Exception): pass class CheckCallFailed(Exception): pass class WaitLinkFailed(Exception): pass
class Role: def __init__(self, data): self.data = data @property def id(self): return self.data["id"] @property def name(self): return self.data["name"] @classmethod def from_dict(cls, data): return cls(data)
__author__ = "Abdul Dakkak" __email__ = "dakkak@illinois.edu" __license__ = "Apache 2.0" __version__ = "0.2.4"
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # # FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier # Distributed under the terms of the new BSD license. # # ----------------------------------------------------------------------------- ""...
def sum(arr): if len(arr) == 0: return 0 return arr[0] + sum(arr[1:]) if __name__ == '__main__': arr = [1,2,3,4,5,6,7,8] print('Test arr: %s' % arr) print('sum = %s' % sum(arr))
#!/usr/bin/env python3 file = 'input.txt' with open(file) as f: input = f.read().splitlines() def more_ones(list, truth): data = [] for i in range(0, len(list[0])): more_ones = sum([1 for x in list if x[i] == '1']) >= sum([1 for x in list if x[i] == '0']) if more_ones: if trut...
class Config(object): MONGO_URI = 'mongodb://172.17.0.2:27017/bibtexreader' MONGO_HOST = 'mongodb://172.17.0.2:27017' DB_NAME = 'bibtexreader' BIB_DIR = 'bibtexfiles'
DATABASES = { 'default': { 'NAME': ':memory:', 'ENGINE': 'django.db.backends.sqlite3', } } SECRET_KEY = 'secret' INSTALLED_APPS = ( 'django_nose', ) TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' NOSE_ARGS = ( 'stopwatch', '--verbosity=2', '--nologcapture', '--with-doctest',...
def dfs(self): """ Computes the initial source vertices for each connected component and the parents for each vertex as determined through depth-first-search :return: initial source vertices for each connected component, parents for each vertex :rtype: set, dict """ parents = {} comp...
__author__ = "Brett Fitzpatrick" __version__ = "0.1" __license__ = "MIT" __status__ = "Development"
input = """ a v b. a :- b. b :- a. """ output = """ {a, b} """
_base_ = './hv_pointpillars_fpn_nus.py' # model settings (based on nuScenes model settings) # Voxel size for voxel encoder # Usually voxel size is changed consistently with the point cloud range # If point cloud range is modified, do remember to change all related # keys in the config. model = dict( pts_voxel_laye...
"""__init__.py - Various utilities to use throughout the system.""" def serialize_sqla(data): """Serialiation function to serialize any dicts or lists containing sqlalchemy objects. This is needed for conversion to JSON format.""" # If has to_dict this is asumed working and it is used. if hasattr(data...
""" Sams Teach Yourself Python in 24 Hours by Katie Cunningham Hour 5: Processing Input and Output Exercise: 1. a) Ask for user input of an item, the number being purchased, and the cost of the item. Then prit out the total and thnak the user for shopping with you. Output should ...
# Copyright (c) 2012 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. { 'variables': { 'chromium_code': 1, }, 'includes': [ '../build/win_precompile.gypi', ], 'targets': [ { 'target_name': 'check_...
class Solution: def maxSlidingWindow(self, nums, k): deq, n, ans = deque([0]), len(nums), [] for i in range (n): while deq and deq[0] <= i - k: deq.popleft() while deq and nums[i] >= nums[deq[-1]] : deq.pop() deq.append(i) ...
TEXT_BLACK = "\033[0;30;40m" TEXT_RED = "\033[1;31;40m" TEXT_GREEN = "\033[1;32;40m" TEXT_YELLOW = "\033[1;33;40m" TEXT_WHITE = "\033[1;37;40m" TEXT_BLUE = "\033[1;34;40m" TEXT_RESET = "\033[0;0m" def get_color(ctype): if ctype == 'yellow': color = TEXT_YELLOW elif ctype == 'green': colo...
########################################################################## # pylogparser - Copyright (C) AGrigis, 2016 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # for details....
# -*- coding: utf-8 class BaseObject: """ Base Unke object type Represents a node in a document. """ def __init__(self, parent=None): self.parent = parent self.children = [] self.name = '' self.properties = {} @property def props(self): return self...
# pylint:enable=W04044 """check unknown option """ __revision__ = 1
class Solution: def duplicateZeros(self, arr: List[int]) -> None: """ Do not return anything, modify arr in-place instead. """ for i in range(len(arr) - 1, -1, -1): if not arr[i]: arr.insert(i + 1, 0) arr.pop()
class ClassPropertyDescriptor(object): #def __init__(self, fget, fset=None): def __init__(self, fget): self.fget = fget #self.fset = fset def __get__(self, obj, klass=None): if klass is None: klass = type(obj) return self.fget.__get__(obj, klass)() ...
s = 1 for c in range(0, 5): n = int(input('número: ')) s += n print('O somatório foi de {}'.format(s))
#Escreva um programa que leia uma string e imprima quantas vezes cada caractere aparece nessa string string = input('Digite uma string: ') count = {} for i in string: count[i] = count.get(i,0) + 1 for chave, valor in count.items(): print(f'{chave}: {valor}x') print()
mitreid_config = { "dbname": "example_db", "user": "example_user", "host": "example_address", "password": "secret" } proxystats_config = { "dbname": "example_db", "user": "example_user", "host": "example_address", "password": "secret" }
aluno = {} aluno['nome'] = str(input('Nome: ')) aluno['media'] = int(input(f'Media do {aluno["nome"]}: ')) if aluno['media'] >= 7: aluno['situaçao'] = 'APROVADO' elif 5 <= aluno['media'] < 7: aluno['situaçao'] = 'RECUPERAÇÃO' else: aluno['situaçao'] = 'REPROVADO' for k, v in aluno.items(): print(f'{k} é...
#!/usr/bin/env python3 #https://codeforces.com/problemset/problem/630/B #直接乘有点太多? #24个月double => 24*30*24*60*60= #想多了,编程语言的power已经足够优化? 快速幂? #https://codeforces.com/blog/entry/24160?locale=en def f(l): n,t = l #1e3-1e4; 2e9; return n*(1.000000011**t) l = list(map(int,input().split())) print(f(l))
num = int(input('Digite um número como base para a PA:\n')) raz = int(input('Digite a razão')) c = 0 while c < 10: print(num+(raz*c)) c += 1
print("Hello World") a =5 b = 6 sum = a+b print(sum) print(sum -11)
# https://leetcode.com/problems/maximum-product-subarray/submissions/ """ For cases like : [2,3,4] => Product is always going to increase since all nums are +ve For cases like : [-2 , -3 , -4] => Product is always going to decrease since all nums are -ve For cases like : [-2 , 3 , 4] => Product may increase or decrea...
# Welcome back, How did you do on your first quiz? If you got most of the # questions right, great job. If not, no worries it's all part of elarning. We'll be here # to help you check that you've really got your head around these concepts with # regular quizzes like this. If you ever find a question tricky, go back and...
""" Entradas Edad1 --> int --> edad_uno Edad2 --> int --> edad_dos Edad3 --> int --> edad_tres Salidas Pormedio --> float --> prom """ edad_uno=int(input("Digite la edad uno: ")) edad_dos=int(input("Digite la edad dos: ")) edad_tres=int(input("Digite la edad tres: ")) #cajanegra prom=(edad_uno+ edad_dos+edad_tres)/3 #S...
def to_huf(amount: int) -> str: """ Amount converted to huf with decimal marks, otherwise return 0 ft e.g. 1000 -> 1.000 ft """ if amount == "-": return "-" try: decimal_marked = format(int(amount), ',d') except ValueError: return "0 ft" return f"{decimal_marked...
class Shirt: title = None color = None def setTitle(self, title): self.title = title def setColor(self, color): self.color = color def getTitle(self): return self.title def getColor(self): return self.color def calculatePrice(self): return len(sel...
""" Message templates to log when handling responses to requests that are SUCCESFUL. Failed requests are logged using the error code contained in the response and its related message. """ resp_get_currency = '{currency}:\n' \ '\t{fullName}({id}):' \ '\tIs a cryptocurrency: {crypto}\n' \ ...
# Python3 program to solve N Queen Problem using backtracking # N = Number of Queens to be placed (in this case, N = 4) global N N = 4 # a function to print the board with the solution def printSolution(board): for i in range(N): for j in range(N): print (board[i][j], end = " ") print() # A function ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/5/21 9:25 # @Author : wildkid1024 # @Site : # @File : extra_params.py # @Software: PyCharm in_size = 28 * 28 layer_size = 256 layer_num = 3 out_size = 10 batch_size = 32 learning_rate = 1e-2 num_epoches = 32 # 统计计算误差的图片个数 statistic_num = 50 dat...
update_user_permissions_response = { 'user': 'enterprise_search', 'permissions': ['permission2'] }
# CPU: 0.05 s n = int(input()) if n % 2 == 0: print((n // 2 + 1) ** 2) else: print((n // 2 + 1) * (n // 2 + 2))
li= list(map(int,input().split(" "))) a=li[0] b=li[1] c=li[2] d=li[3] flag=0 if(a==(b+c+d)): flag=1 elif(b==(a+c+d)): flag=1 elif(c==(a+b+d)): flag=1 elif(d == (a+b+c)): flag=1 elif((a+b) == (c+d)): flag=1 elif((a+c) == (b+d)): flag=1 elif((a+d) == (b+c)): flag=1 if(flag ==1): print("Yes") else: print...
# Generated by [Toolkit-Py](https://github.com/fujiawei-dev/toolkit-py) Generator # Created at 2022-02-06 10:58:35.566935, Version 0.2.9 __version__ = '0.0.5'
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: de...
def get_expenses_from_input(input_location): f = open(input_location, 'r') expenses = f.read().split('\n') f.close() expenses_list_number = [] for expense in expenses: expenses_list_number.append(int(expense)) expenses_list_number.sort() return expenses_list_number def get_thr...
#!/usr/bin/python class LSRConfig: # Downstream on demand, unsolicited downstream, or default # Label distribution protocol # Label retention mode LABEL_RETENTION = False # re-use labels at peers (aka "per interface" scope) # only applicable for peers that come into different local interfaces P...
#Speichern eines Textes try: #1 daten=open("Daten\daten1.txt","w") #2 text=input("Bitte geben Sie Ihren Namen ein: ") daten.write(text) #3 daten.flush() #Zwischenspeicherung der Datei ohne sie zu schließen! daten.c...
tree_map = """.......#................#...... ...#.#.....#.##.....#..#....... ..#..#.#......#.#.#............ ....#...#...##.....#..#.....#.. ....#.......#.##......#...#..#. ...............#.#.#.....#..#.. ...##...#...#..##.###...##..... ##..#.#...##.....#.#..........# .#....#..#..#......#....#....#. .....................
# data for single play num_rows = 23 num_columns = 10 block_size = 60 screen_width = block_size * 40 screen_length = block_size * 22 field_width = block_size * 10 field_length = block_size * 20 field_x = block_size * 7 field_y = block_size * 1 hold_ratio = 0.8 hold_block_size = block_size * hold_ratio hold_width =...
# This file will be patched by setup.py # The __version__ should be set to the branch name # Leave __baseline__ set to unknown to enable setting commit-hash # (e.g. "develop" or "1.2.x") # You MUST use double quotes (so " and not ') __version__ = "3.2.0-develop" __baseline__ = "unknown"
def hideUnits(units): for i in range(len(units)): hero.command(units[i], "move", {x: 34, y: 10 + i * 12}) peasants = hero.findFriends() types = peasants[0].buildOrder.split(",") for i in range(len(peasants)): hero.command(peasants[i], "buildXY", types[i], 16, 10 + i * 12) while True: ...
class Solution: def findDisappearedNumbers(self, nums: List[int]) -> List[int]: unique = set(nums) ans = [] for i in range(1, len(nums) + 1): if not i in unique: ans.append(i) return ans
# https://www.codingame.com/training/easy/the-dart-101 TARGET_SCORE = 101 def simulate(shoots): rounds, throws, misses, score = 1, 0, 0, 0 prev_round_score = 0 prev_shot = '' for shot in shoots.split(): throws += 1 if 'X' in shot: misses += 1 score -= 20 ...
file = open("sentencesINA.txt","r") file_lines = file.readlines() file.close() good_sentences = set([]) sentences = set([]) count = 0 big_sen_count = 0 good_sen_count = 0 good_value_count = 0 error = 0 for line in file_lines: first_split = line.find("|| (('") sentence = line[0:first_split] split = line[...
# Neat trick to make simple namespaces: # http://stackoverflow.com/questions/4984647/accessing-dict-keys-like-an-attribute-in-python class Namespace(dict): def __init__(self, *args, **kwargs): super(Namespace, self).__init__(*args, **kwargs) self.__dict__ = self
def question(n, pn): _ = int(n) expn = list(map(int, pn.split())) p = 1 for pi in expn: # 加算した場合(p << pi)と加算しなかった場合pの両方のビットを立る p = (p << pi) | p # 最終的にビットが立っている個数を数える return f"{bin(p).count('1')}"
# # @lc app=leetcode id=1448 lang=python3 # # [1448] Count Good Nodes in Binary Tree # # https://leetcode.com/problems/count-good-nodes-in-binary-tree/description/ # # algorithms # Medium (72.08%) # Likes: 1462 # Dislikes: 52 # Total Accepted: 102.9K # Total Submissions: 141.1K # Testcase Example: '[3,1,4,3,null...
#!/usr/bin/python # # Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es) # # 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 ...
class boyce(object): def bmMatch(self, pattern): #algoritma didapatkan dari slide pa munir last=[] last = self.buildLast(pattern) n = len(self.text) m = len(pattern) i = m-1 if (i > n-1): return -1 #kalo ga ketemu file bersangkutan j = m-1;...
'''Crie uma tupla preenchida com os 20 primeiros colocados da Tabela do Campeonato Brasileiro de Futebol, na ordem de colocação. Depois mostre: a) Os 5 primeiros times. b) Os últimos 4 colocados. c) Times em ordem alfabética. d) Em que posição está o time da Chapecoense.''' classifBrasileirao = ('Flamengo', 'Sa...
"""Event classes and event-processing mechanisms This package defines a set of "local" event classes which are to be used by client applications. These include keyboard, keypress, mousebutton and mousemove events. The package also defines a set of modules which translated from GUI events/ callbacks to the local even...
def whataboutstarwars(): i01.disableRobotRandom(30) # PlayNeopixelAnimation("Ironman", 255, 255, 255, 1) sleep(3) # StopNeopixelAnimation() i01.disableRobotRandom(30) x = (random.randint(1, 3)) if x == 1: fullspeed() i01.moveHead(130,149,87,80,100) AudioPlayer.playFile(RuningFolder+'/sys...
class_cpp_header = """\ #include <pybind11/pybind11.h> #include <pybind11/stl.h> {includes} #include "{class_short_name}.cppwg.hpp" namespace py = pybind11; typedef {class_full_name} {class_short_name};{smart_ptr_handle} """ class_cpp_header_chaste = """\ #include <pybind11/pybind11.h> #include <pybind11/stl.h> {incl...
# BGR Blue = (255, 0, 0) Green = (0, 255, 0) Red = (0, 0, 255) Black = (0, 0, 0) White = (255, 255, 255)
def solve_power_consumption(): """Print the power consumption.""" with open('../data/day03.txt') as f: lines = [line.strip() for line in f] ones = [sum(bit == '1' for bit in column) for column in zip(*lines)] gamma = ''.join('1' if n > len(lines) / 2 else '0' for n in ones) epsilon = ''.joi...
# #08 Anomalous Counter! # @DSAghicha (Darshaan Aghicha) def counter_value(timer: int) -> int: if timer == 0: return 0 counter_dial: int = 0 prev_dial: int = 0 cycle_dial: int = 0 counter = 0 while timer > counter_dial: counter += 1 prev_dial = counter_dial c...
__version__ = '0.1.3' __title__ = 'dadjokes-cli' __description__ = 'Dad Jokes on your Terminal' __author__ = 'sangarshanan' __author_email__= 'sangarshanan1998@gmail.com' __url__ = 'https://github.com/Sangarshanan/dadjokes-cli'
""" misc/bi_tree.py """ class BiTree: """ Binary Indexed Tree is represented as an array. Each node of the Binary Indexed Tree stores the sum of some elements of the original array. The size of the Binary Indexed Tree is equal to the size of the original input array, denoted as n. This class use a...
# -*- coding: utf-8 -*- class Header(object): def __init__(self, name): if (isinstance(name, Header)): name = name.normalized name = name.strip() self.normalized = name.lower() def __hash__(self): return hash(self.normalized) def __eq__(self, righ...
# -*- coding: utf-8 -*- """Top-level package for SlimStaty.""" __author__ = """Andy Mroczkowski""" __email__ = 'a@mrox.co' __version__ = '0.1.0'
#работаем с оператором условия brand='Volvo' engine_volume=1.6 #объем двигателя horsepower=200 #лошадиные силы sunroof=True #люк на крыше # проверка условия # if horsepower<80:print("No tax") # else:print('Tax') # tax=0 # # if horsepower<80: # tax=0 # elif horsepower<100: # tax=1000 #...
class Solution: def validateStackSequences(self, pushed: List[int], popped: List[int]) -> bool: if not pushed and not popped: return True if len(pushed) != len(popped): return False popIdx = 0 count = 0 stack = [] for i in range(len(p...
""" 62. Unique Paths Medium 7114 267 Add to List Share A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram...
unsorted_list = [("w",23), (9,1), ("543",99), ("sena",18)] print(sorted(unsorted_list, key=lambda x: x[1])) list = [43, 743, 342, 8874, 49] print(sorted(list, reverse=True))
# This is a handy reverses the endianess of a given binary string in HEX input = "020000000001017c037e163f8dfee4632a8cf6c87187d3cb61224e6dae8f4b0ed0fae3a38008570000000017160014c5729e3aaacb6a160fa79949a8d7f1e5cd1fbc51feffffff0288102c040000000017a914ed649576ad657747835d116611981c90113c074387005a62020000000017a914e62a29...
# startswith # endswith inp = "ajay kumar" out = inp.startswith("aj") print(out) out = inp.startswith("jay") print(out) # inp1 = "print('a')" inp1 = "# isdecimal -> given a string, check if it is decimal" out = inp1.startswith("#") print(out)
class Queue(object): """ Implment Queue using List """ def __init__(self): self._list = [] def enqueue(self, value): self._list.append(value) def dequeue(self): try: value = self._list[0] del self._list[0] return value ...
# -*- coding: utf-8 -*- """ Created on Fri Jun 21 15:44:41 2019 @author: f.divruno """ ms = 1e-3 us = 1e-6 MHz = 1e6 GHz = 1e9 km = 1e3 minute = 60 hr = 60*minute km_h = km/hr k_bolt = 1.38e-23 def Apply_DISH(Telescope_list,Band='B1',scaling = 'Correlator_opimized', atten = 0): """ scaling: ...
for _ in range(int(input())): a,b,c=map(int,input().split()) ans=a+c-b-b ans=abs(ans) c1=ans%3 c2=ans%(-3) c2=abs(c2) if c1<c2: print(c1) else: print(c2)
"""Config for the `config-f` setting in StyleGAN2.""" _base_ = ['./stylegan2_c2_ffhq_256_b4x8_800k.py'] model = dict( disc_auxiliary_loss=dict(use_apex_amp=False), gen_auxiliary_loss=dict(use_apex_amp=False), ) total_iters = 800002 apex_amp = dict(mode='gan', init_args=dict(opt_level='O1', num_losses=2)) re...
r1 = float(input('Digite o valor do Primeiro Segmento: ')) r2 = float(input('Digite o valor do Segundo Segmento: ')) r3 = float(input('Digite o valor do Terceiro Segmento: ')) if r1 < r2+r3 and r2< r1+r3 and r3 < r1+r2: print('Os segmnetos acima podem formar triângulo') else: print('Os segmnetos acima não podem...
# Author: Mujib Ansari # Date: Jan 23, 2021 # Problem Statement: WAP to check given number is palindorome or not def check_palindorme(num): temp = num reverse = 0 while temp > 0: lastDigit = temp % 10 reverse = (reverse * 10) + lastDigit temp = temp // 10 return...
# # PySNMP MIB module CXCFG-IP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CXCFG-IP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:16:46 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,...
class AttackGroup: def __init__(self, botai, own, targets, iter): self.botai = botai self.own = own self.targets = targets self.iteration = iter @property def done(self): return len(self.own) == 0 or len(self.targets) == 0 def actions(self, iter): action...
def test_sm_create_contact_list(app): i = "Перейти в списки компаний" text = "список компаний %s" app.testhelpersm.refresh_page() app.session.open_SM_page(app.smParticipants) app.session.ensure_login_sm(app.username, app.password) app.session.ensure_login_sm(app.username, app.password) app...