content
stringlengths
7
1.05M
""" Parameters of the FLAT data sets, as documented for Kinect2 camera in the FLAT code""" resolution = [424, 512] fov_real = [58.5, 46.6] fov_synth = [42.13, 42.13] # frequencies of the first and last 3 measurements, the middle measurements are not sinusoidal frequencies = [40, 1e2 / 3.3, 1e2 / 1.7] frequencies_2 =...
FUNC_ORDER = [ "do_fetch", "do_unpack", "do_patch", "do_configure", "do_compile", "do_install", "do_populate_sysroot", "do_build", "do_package" ] KNOWN_FUNCS = [ "do_addto_recipe_sysroot", "do_allpackagedata", "do_ar_configured", "do_ar_original", "do_ar_patched"...
class ListNode(object): def __init__(self, x): self.val = x self.next = None class MyLinkedList(object): def __init__(self): """ Initialize your data structure here. """ self.head = None def get(self, index): cur = self.getnthnode(index) if ...
def test(name, input0, input1, output0, input0_data, input1_data, output_data): model = Model().Operation("REVERSE_EX", input0, input1).To(output0) example = Example({ input0: input0_data, input1: input1_data, output0: output_data, }, model=model, name=name) test( name="1d", input0=Inpu...
def get_gender(gender = 'Unknown'): if gender is 'm': gender="male" elif gender is 'f': gender='female' print("Gender is ", gender) get_gender('m') get_gender('f') get_gender() def sentence(name = 'Aousnik', gender = 'male', category = 'general'): print(name, gender, catego...
list = [1,2,3,4] test_list = list1 test_list.reverse() print(list)
class Company: name = '' def __init__(self, name): self.name = name def add(self, company): pass def remove(self, company): pass def display(self, depth): pass def listDuty(self): pass class ConcreteCompany(Company): childrenCompany = None def __i...
#!/usr/local/bin/python3 # encoding:utf-8 def catchException(): while True: try: x = int(input("Please input a number\n")) break except ValueError: print("Oops! That was no valid number. Try again ") def raiseException(): raise NameError("raise Excepti...
class Solution: def minCost(self, costs: List[List[int]]) -> int: if not costs: return 0 lower_row = costs[-1] for i in range(len(costs)-2, -1, -1): curr_row = costs[i] curr_row[0] += min(lower_row[1], lower_row[2]) curr_row[1] += min(lower_row[0], lower_r...
__author__ = 'harsh' class Iterable(object): def __init__(self,values): self.values = values self.location = 0 def __iter__(self): return self def next(self): if self.location == len(self.values): raise StopIteration value = self.values[self.location]...
"""Base class for SHADHO task managers. Classes ------- Manager Base class for task managers. """ class Manager(): """Base class for task managers. Notes ----- To implement a new local or distributed manager, create an __init__ method and override all """ def __init__(self): ...
# # PySNMP MIB module Nortel-Magellan-Passport-FrameRelayDteMIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-FrameRelayDteMIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:17:39 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user da...
""" This module holds all the sql statements for List_Tags """ #------------------------------------------------------ # Select all the tags assigned to a list # # 2 parms: # - list_id # - user_id #------------------------------------------------------ SELECT_ALL = ''' SELECT * FROM View_Tags vt WHE...
query_issues = """ { repository(name: "{placeholder_nome_repo}", owner: "{placeholder_owner_repo}") { issues(filterBy: {labels: ["BUG", "bug", "Bug", "Type: Bug", "Type: BUG", "Type: bug", "type: Bug", "type: BUG", "type: bug", "browser bug", "Error", "ERROR", "error", "Failure", "FAILURE", "failure...
""" Crie um programa que leia um número inteiro e mostre na tela se ele é PAR ou IMPAR. """ numero = int(input('Informe um número: ')) if numero % 2 == 0: print(f'O número {numero} é PAR!') else: print(f'O número {numero} é IMPAR!')
numbers = [1,21,4234,423432,42345,324] largest = numbers[0] for x in numbers: if largest < x: largest = x print(f'The largest value is : {largest}')
# -*- coding: utf-8 -*- class Solution: def matrixReshape(self, nums, r, c): original_r, original_c = len(nums), len(nums[0]) if r * c != original_r * original_c: return nums tmp = [nums[i][j] for i in range(original_r) for j in range(original_c)] result = [] ...
#food = "Python's favorite food is perl" #say = "\"Python is very easy.\" he says" #print(say) #multiline = """ # Test1 # Test2 #""" #print(multiline) a = "Test" b = "123" print(a+b)
def clientFunction(args, files): print('client function call with args ' + str(args) + ' and files ' + str(files)) return args if __name__ == "__main__": clientFunction()
# Instructions print('''This short program computes the circumference of a circle from a provided raduis. Provide the radius as a floating point value.\n''') # Prompt user for circumference radius = input('Enter a radius: ') # Assume correct type circ = 2 * 3.14159 * float(radius); # Provide output print(f'The circ...
# 刚下单 ORDERED = 0 # 订单已付款 PAYED = 1 # 订单已发货 SENDED = 2
class Place: destination="" iata_code = "" attractions_list =[] hotels_list = [] weather = [] flights = [] restaurants_list = [] def __init__(self, iata_code): self.iata_code = iata_code
# tutorial 38 revison of chapter 2 a=int(input("enter first number : ")) b=int(input("enter second number : ")) total=a+b print("total is " + str(total))
class Request(object): """ Represents a request of a product. """ def __init__(self): self.backend_object = None self.amount = None self.name = None self.due = None self.impossible = False self.due = None def set(self, name, amount, obj): self.name ...
extenso = ('Zero', 'Um', 'Dois', 'Três', 'Quatro', 'Cinco', 'Seis', 'Sete', 'Oito', 'Nove', 'Dez', 'Onze', 'Doze', 'Treze', 'Quatorze', 'Quinze', 'Dezesseis', 'Dezessete', 'Dezoito', 'Dezenove', 'Vinte') continuar = 'S' num = 0 while continuar != 'N': while True: num = int(input('Digite um ...
__title__ = 'icd10-cm-ng' __description__ = ('ICD-10 codes for diseases, signs and symptoms, abnormal findings, ' 'complaints, social circumstances, and external causes of injury or disease') __url__ = 'https://github.com/AberystwythSystemsBiology/icd10-cm-ng' __version__ = '0.0.5' __author__ = 'Keir...
""" 16. Utilize uma lista para resolver o problema a seguir. Uma empresa paga seus vendedores com base em comissões. O vendedor recebe $200 por semana mais 9 por cento de suas vendas brutas daquela semana. Por exemplo, um vendedor que teve vendas brutas de $3000 em uma semana recebe $200 mais 9 por cento de $3000, ...
def layout_instructors(instructors) -> str: result = '' for instructor in instructors[:-1]: result += '{}; '.format(instructor) else: result += '{}'.format(instructors[-1]) return result def layout_enr(enr) -> str: return enr.split('/')[0] if '/' in enr else enr
# Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. # If the last word does not exist, return 0. # Note: A word is defined as a character sequence consists of non-space characters only. # Example: # Input: "Hello World" # Output: 5 ...
def time_diff(time_vals): time1 = time_vals time2 = time_vals.shift(1) delta = time1 - time2 return delta
""" CherryPy Config server settings module. """ __author__ = 'Jovan Brakus <jovan@brakus.rs>' __contact__ = 'jovan@brakus.rs' __date__ = '31 May 2012' CONFIG_FILENAME = "config_server.ini" WEBSERVER_HOST = '0.0.0.0' WEBSERVER_PORT = 8080 USERS = {'cherrypy': '57ed5d98cce71967d508cb785aa76d2c23894347'} # SHA...
nome = input('Qual seu nome? ') idade = input('Digite sua idade: ') peso = input('Digite seu peso: ') print(nome, idade, peso)
def main(): """Main program """ digits = [] while True: new_dig = input("Enter a digit. Enter E to exit.\n") if new_dig == "E": break digits.append(new_dig) print(sorted(digits)) if __name__ == "__main__": main()
expected_output = { "test_genie_1": { "color": 0, "name": "test_genie_1", "status": { "admin": "down", "operational": { "since": "05-18 03:50:08.958", "state": "down", "time_for_state": "00:00:01", }, ...
# you can write to stdout for debugging purposes, e.g. # print("this is a debug message") def solution(X, Y, D): # write your code in Python 3.6 total_distance = Y - X rounded_number_of_jumps = total_distance // D division_rest = total_distance % D return rounded_number_of_jumps if division_rest ...
def minimum_swaps(ratings: list) -> int: # get the rating compliment value. That is, lower value is higher rating complmnt = [len(ratings)-val+1 for val in ratings] len_arr = len(complmnt) idx = 0 swap_counter = 0 while idx < len_arr: if complmnt[idx] != (idx+1): # swap the values ...
#Somatorio de respostas das perguntas repetidas s = 0 for c in range (0,3): n = int(input('Digite o valor que será somado: ')) s = s+n #Tambem pode ser S +=n print(' A soma é {}'.format(s))
def getPointsInOrder(box,flag): ''' returns in top-left, top-right, bottom-left, bottom-right order ''' ret = [] if flag==0: ret = [box[1],box[2],box[0],box[3]] else: ret = [box[2],box[3],box[1],box[0]] return ret
# Bus communication SJ_DefaultBaud = 115200 SJ_DefaultPortIn = 5000 # General SJ_Timeout = 100 #in ms SJ_CommandStart = "#" SJ_CommandEnd = "\r" #actions SJ_ActionLED = "LED" SJ_BlinkLED = "BLK" SJ_BlinkLEDSTOP = "NBLK" SJ_FetchTemperature = "ATMP" #response SJ_Temperature = "RTMP" # LED colors NAVIO_LED_Blac...
#Faça um programa que implemente uma caixa registradora rudimentar. O programa deverá receber um número desconhecido de valores referentes aos preços das mercadorias. Um valor zero deve ser informado pelo operador para indicar o final da compra. O programa deve então mostrar o total da compra e perguntar o valor em din...
starts_with_B = { 'B&':'Banned', 'B2B':'Business-to-business', 'B2C':'Business-to-consumer', 'B2W':'Back to work', 'B8':'Bait', ('B/F','BF'):'Boyfriend', ('B/G','BG'):'Background', ...
# coding: utf-8 n = int(input()) x = [int(i) for i in input().split()] while True: tmp = min(x) for i in range(n): if x[i]%tmp == 0: x[i] = tmp else: x[i] %= tmp if sum(x) == tmp*n: break print(sum(x))
# By manish.17, contest: ITMO Academy. Двоичный поиск - 2, problem: (A) Packing Rectangles # https://codeforces.com/profile/manish.17 w, h, n = map(int, input().split()) alpha, omega = 1, 10**18 while alpha < omega: mid = (alpha+omega)//2 if mid < max(w, h): alpha = mid + 1 continue count...
string = str(input("Enter numbers for polynom divided by whitespaces: ")) polynums = string.split(" ") sum = 0 i = 0 while i<len(polynums): sum += (1 / int(polynums[i])) i +=1 print("Answer is ", sum)
# coding=utf-8 # # @lc app=leetcode id=64 lang=python # # [64] Minimum Path Sum # # https://leetcode.com/problems/minimum-path-sum/description/ # # algorithms # Medium (45.58%) # Likes: 1536 # Dislikes: 42 # Total Accepted: 250.8K # Total Submissions: 521.7K # Testcase Example: '[[1,3,1],[1,5,1],[4,2,1]]' # # Gi...
# o(n) time # o(n) space def find_best_schedule(appointments): n = len(appointments) dp = [0] * (n + 1) dp[-2] = appointments[-1] max_so_far = -float("inf") for i in reversed(range(n - 1)): choices = [] # choice 1, take the ith element, then skip i+1, and take i+2. choice...
print('=-' * 15) print('CALCULADORA') print('=-' * 15) opcao = 0 num1 = int(input('Digite um numero: ')) num2 = int(input('Digite outro numero: ')) while not opcao == 5: print('-' * 30) print('''Qual operação voce deseja realizar: [ 1 ] SOMAR [ 2 ] MULTIPLICAR [ 3 ] MAIOR [ 4 ] NOVOS NUMEROS ...
# import sys # sys.setrecursionlimit(1000) # print(sys.getrecursionlimit()) def factorial(n): """Calculate n factorial n int > 0 returns n! """ if n == 1: return 1 return n * factorial(n - 1) n = int(input('Input a integer to get the factorial value: ')) print(f'{n} factorial = {factor...
enc = map(int,raw_input("Paste the cipher.txt here \n").split(',')) for a in range(26): a += ord('a') for b in range(26): b += ord('a') for c in range(26): c += ord('a') dec = [x for x in enc] f = 0 for i in range(len(dec)): if i %3...
# creating an empty hash table from 5 items hash_table = [[] for _ in range(5)] print(hash_table) # insterting keys and values to it def insert(hash_table, key, value): hash_key = hash(key) % len(hash_table) key_exists = False bucket = hash_table[hash_key] for i, kv in enumerate(bucket): k, ...
# -*- coding: utf-8 -*- even = 0 odd = 0 positive = 0 negative = 0 for i in range(5): A = float(input()) if (A % 2) == 0: even +=1 elif (A%2) != 0 and A != 0: odd+=1 if A > 0: positive +=1 elif A < 0: negative +=1 print("%i valor(es) par(es)"%even) print("%i valor(es...
''' Оператор Проверяемое условие == Равенство != Неравенство > Больше < Меньше >= Больше либо равно <= Меньше либо равно ''' # Пять переменных для сравнения nil = 0 num = 0 max = 1 cap = 'A' low = 'a' # Добавля...
x = input() y = input() z = input() if x == 'vertebrado': if y == 'ave': if z == 'carnivoro': print('aguia') elif z == 'onivoro': print('pomba') elif y == 'mamifero': if z == 'onivoro': print('homem') elif z == 'herbivoro': print('v...
# Copyright (c) 2018 PaddlePaddle 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 app...
# -*- coding:utf-8 -*- """ 自定义异常 """ class QuizException(Exception): """ 前端参数异常 """ status_code = 400 def __init__(self, message): super(QuizException, self).__init__(message) self.message = message def __iter__(self): for k in ['message', 'status_code']: ...
def test_head_request_(): pass def test_status_smaller_100(): pass def test_not_modified_304(): pass def test_no_content_204(): pass def test_reset_content_205(): pass
# Prison Break # # Find the largest area created in the cell after removing horz and vert rods # Solution: Find the longest seq of rods removed from horz * longest seq of rods removed from vert # Time O(n+m) Space O(1) def find_max_gap(size, rods): # track curr gap, max gap, and prev rod removed prev = -1 ...
# import time # a = time.localtime() # print(a) file = open("test", "r") # file_lines = file.readlines() # for line in file: # print(line) # # for line in file_lines: # print(line) while True: data = file.read(5) print(data) if not data: break
# -*- coding: utf-8 -*- SMILLY_ITEMS = ["Duplicate Code", "Long Methods", "Ugly Variable Names"] BACKSTAGE_PASSES = ["Backstage passes for Re:Factor" ,"Backstage passes for HAXX"] GOOD_WINE = "Good Wine" LEGENDARY_ITEM = "B-DAWG Keychain" class GildedRose(object): def __init__(self, items): self.items = i...
def spp(): a = [1, 2, 3, 4] val = 3 print(a.index(val)) if __name__ == '__main__': spp()
# You are given with an array of numbers, # Your task is to print the difference of indices of largest and smallest number. # All number are unique. N = int(input("")) array = list(map(int, input().split(" ")[:N])) maxIndex = 0 minIndex = 0 max = array[0] min = array[0] for i in range(1, len(array)): if(array[i] ...
class ObjectAlreadyInCollection(Exception): pass class CollectionIsLocked(Exception): pass
# SUPPLY class Supply: vid = 0 v_bulk = 0 v_proc = 0 i_inst = 0 proc_max_i = 0 proc_min_i = 0 proc_max_v = 0 proc_min_v = 0 rpdn = 0 rll = 0 def __init__(self, rpdn, rll, vcc_max, vcc_min, imax, imin): self.rpdn = rpdn self.rll = rll self.proc_max_i = imax self.proc_min_i = im...
def intersection(lst1, lst2): """ >>> intersection([1, 2, 3], [2, 4, 6]) [2] >>> intersection([1, 2, 3], [4, 5, 6]) [] >>> intersection([2, 3, 2, 4], [2, 2, 4]) [2, 4] """ in_both = [] for item1 in lst1: for item2 in lst2: if item1 == item2 and item2 not in i...
# The list is generated using https://w.wiki/aaD # Picking the top 50 ones only because it covers 97% of cases ASTRONOMICAL_OBJECTS = [ 'Q523', 'Q318', 'Q1931185', 'Q1457376', 'Q2247863', 'Q3863', 'Q83373', 'Q2154519', 'Q726242', 'Q1153690', 'Q204107', 'Q71963409', 'Q67206691', 'Q1151284', 'Q67206701', 'Q66...
class InvalidToken(Exception): """An Exception Raised When an Invalid Token was Supplied.""" def __init__(self): super(InvalidToken, self).__init__("An Invalid Bearer Token was Supplied to Weverse.") class PageNotFound(Exception): r""" An Exception Raised When a link was not found. Parame...
# Shunting algorithm # Jose Retamal # Graph theory project GMIT 2019 # This algorithm is base on: # http://www.oxfordmathcenter.com/drupal7/node/628 # https://web.microsoftstream.com/video/cfc9f4a2-d34f-4cde-afba-063797493a90 class Converter: """ Methods for converting string. toPofix() implement, ...
class Solution: def helper(self, n: int): if n == 0: return (0, 1) else: a, b = self.helper(n // 2) c = a * (b * 2 - a) d = a * a + b * b if n % 2 == 0: return (c, d) else: return (d, c + d) ...
''' Kattis - blackout We start by blocking off 1 row, then we are left with a 4x6 grid, notice that both lengths are even! So what we can do is to mirror the moves of the opponent on both axes and then we will definitely win!s Time: O(1), Space: O(1)''' num_tc = int(input()) for _ in range(num_tc): print("5 1 5 6"...
def hero_to_zeroa(n:int, k:int)->int: step = 0 while(n>0): step += n%k n = (n//k) * k if n == 0: break step += 1 n //= k return step numtest = int(input().strip()) for _ in range(numtest): line = input().strip().split() ...
num = int(input("Enter a number:\n")) if num % 5 == 0: print(f"{num} is a multiple of 5.") else: print(f"{num} is not a multiple of 5.")
# Fibonacci Pyramid a = 1 b = 2 s = a + b m = 1 n = int(input('Enser no. of rows')) d = n - 1 for i in range(0, n): for j in range(0, d): print(" ", end = ' ') for k in range(0, m): print(a, " ", end = ' ') s = a + b a = b b = s print() d -= 1 m += 1
def not_string (n): for i in range (1,n): print(i,end='') return n n = int(input()) print(not_string(n))
def hi(): print ('Hello world!') print(hi())
# Flipping bits # You will be given a list of 32-bits unsigned integers. You are required to output the list of the unsigned integers you get by flipping bits in its binary representation (i.e. unset bits must be set, and set bits must be unset). def flipping(a): ans = ~a & 0xffffffff return ans n = int(raw...
TITLE = "PyKi" PRIVATE = True FILE_SIZE_MAX_MB = 16 SECRET_KEY= "a unique and long key" CONTENT_DIR = "C:\\Users\\ongew\\Desktop\\Transfer\\CSC 440\\Projects\\PyKi\\content" UPLOAD_DIR = "C:\\Users\\ongew\\Desktop\\Transfer\\CSC 440\\Projects\\PyKi\\wiki\\web\\static\\upload" CONNECTION_STRING = "DRIVER={SQLite3 ODBC D...
LogLevels = { "Fatal": 0, "Error": 1, "Warning": 2, "Notice": 3, "Info": 4, "Debug": 5, "Trace": 6 } class Logger: def __init__(self, log_level): self.log_level = log_level def log(self, level, message): if int(self.log_level) >= int(level): print(messa...
class Solution: def findDifference(self, nums1: List[int], nums2: List[int]) -> List[List[int]]: answer = [] res = [] [res.append(i) for i in nums1 if i not in res and i not in nums2] answer.append(res[:]) res = [] [res.append(i) for i in nums2 if i not in res and i n...
def insertionSort(array): # loop through unsorted elements, considering first element sorted for i in range(1, len(array)): # select first unsorted element elementToSort = array[i] # initialize position as the previous position position = i - 1 # loop through last sorted...
# -*- coding:utf-8 -*- """ Python内置了字典:dict的支持,dict全称dictionary,在其他语言中也称为map,使用键-值(key-value)存储,具有极快的查找速度。 """ d = {"zhangshang":20,"LiSi":20,"wangwu":18} print('根据name来获得age:',d['zhangshang']) #添加一个值 d["zhaoliu"]=50 print("字典里的数值:",d) #如果字典里的name不存在会报错,这时候可以使用in来判断name是否存在 print('zhangshang是否存在:','zhangshang' in d...
class LoadData(): """ Loads data from a trace input file into an array of shape (N, 2), where N represents the Total Memory Requests and 2 represents cache input. """ def __init__(self, filename): #assuming N x 2. self.filename = filename self.memory = [] def to_bin(self, add...
''' Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum number of jumps. Example: Input: [2,3,1,1,4] Output: 2 Explanation: The minim...
def aliquot_sum(n: int) -> int: return sum([factor for factor in range(1, n//2+1) if n % factor == 0]) def classify(number: int) -> str: """ A perfect number equals the sum of its positive divisors. :param number: int a positive integer :return: str the classification of the input integer """ ...
# Retourne un booléen, True si la phrase est un palindrome, False si ce n'est pas le cas def estPalindrome(phrase): phraseTaille = len(phrase) - 1 # Taille de la phrase -1 car commence à 0 nouvellePhrase = "" # Phrase qui va être inversée indexNormal = 0 # IndexNormal commence à compter à partir de 0 # ...
@app.route("/transaction", methods=['GET','POST']) def transactions(): Create_Transaction_Form = CreateTransactionForm(request.form) user_id = session['user_id'] if request.method == 'POST': first_name = Create_Transaction_Form.first_name.data last_name = Create_Transaction_Form.last_name.da...
# # PySNMP MIB module Nortel-Magellan-Passport-ModAtmQosMIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-ModAtmQosMIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:18:26 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 #...
''' In place quickSort The quickSort Method Time Complexity : Best,Avg - O(NlogN) , Worst - O(N^2) Space Complexity : O(N) Auxilary Space : O(logN) for the stack frames ''' def quickSort(a,start,end): if(start >= end): return a else: pivot = a[end] swapIndex = start for i in...
def f(lst): lst.reverse() lst.append(42) return lst L = [1, 2, 3] counter = 2 while counter > 0: len(f(f((f(L))))) # breakpoint counter -= 1
def createCalendar(month): ac = '' days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] for i in days: ac = ac + i + ' ' print(f'\n {month}\n') print(ac) createCalendar('March')
# conversor de distância distance = int(input('Uma distância em metros:')) print('{}km \n{}hm\n {}dam\n {}m\n {}dm\n {}cm\n {}mm'.format( distance /1000, distance / 100, distance / 10, distance, distance * 10, distance * 100, distance * 1000, ))
""" Given a nested list of lexemes that have been parsed from a boolean expression, factor everything out into a list-of-lists of conjunctions (AND combinations). For example, given an expression like "(a or b and c) and (e or f)" It is first parsed into [['a', 'or', 'b', 'and', 'c'], 'and', ['e', 'or', 'f']] Then it ...
#Algoritmos Computacionais e Estruturas de Dados #5a Lista de Exercícios #Prof.: Laercio Brito #Dia: 28/10/2021 #Turma 2BINFO #Alunos: #Dora Tezulino Santos #Guilherme de Almeida Torrão #Mauro Campos Pahoor #Victor Kauã Martins Nunes #Victor Pinheiro Palmeira #Questão 5 tam = int(input("Digite o tamanho da matriz quad...
def load_loss_function(loss_class, *args, **kwargs): loss_function = loss_class(*args, **kwargs) return loss_function
#!/usr/bin/env python2.7 #-*- coding: utf-8 -*- QTUM_PREFIX = "/home/danx/std_workspace/qtum-package/" QTUM_BIN = QTUM_PREFIX + "bin/" CMD_QTUMD = QTUM_BIN + "qtumd" CMD_QTUMCLI = QTUM_BIN + "qtum-cli" ######################################## QTUM_NODES = { 'node1': { 'NODEX__QTUM_DATAD...
# Write a function called get_info that receives a name, an age, and a town and returns a string in the format: # "This is {name} from {town} and he is {age} years old". Use dictionary unpacking when testing your function. Submit only the function in the judge system. def get_info(**kwargs): return f"This is {kw...
#encoding:utf-8 subreddit = 'learntodraw' t_channel = '@Learntodrawx' def send_post(submission, r2t): return r2t.send_simple(submission)
s = "" for i in range(1, 1000): s += str(i) x = int(input()) print(s[x-1])
""" DatabaseSetingsModule ---------------------- This is a Module which has Class for Database and database Settings """ class Database(object): """Database Class which is responsile for connecting to databse """ def __init__(self, connection_string): """ This is connection string o connect...
# Copyright 2016 Recorded Future, Inc. # # 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...
def splitter(string): split = string.split(' ') return split print(splitter('this is a very messy string'))