content
stringlengths
7
1.05M
class Rocket: def calc_fuel_weight(self, weight): weight = int(weight) return int(weight / 3) - 2 def calc_fuel_weight_recursive(self, weight): weight = int(weight) # This time with recursion for fuel weight total = self.calc_fuel_weight(weight) fuelweig...
def captial(string): strs = string.title() return strs n = input() n = captial(n) print(n)
''' Copyright (c) 2012-2021 Roel Derickx, Paul Norman <penorman@mac.com>, Sebastiaan Couwenberg <sebastic@xs4all.nl>, The University of Vermont <andrew.guertin@uvm.edu>, github contributors Released under the MIT license, as given in the file LICENSE, which must accompany any distribution of this code. ''' __author__...
streams_dict = {} def session_established(session): # When a WebTransport session is established, a bidirectional stream is # created by the server, which is used to echo back stream data from the # client. session.create_bidirectional_stream() def stream_data_received(session, ...
""" Политическая жизнь одной страны очень оживленная. В стране действует K политических партий, каждая из которых регулярно объявляет национальную забастовку. Дни, когда хотя бы одна из партий объявляет забастовку, при условии, что это не суббота или воскресенье (когда и так никто не работает), наносят большой ущерб эк...
"""gcam_cerf_expansion Generate an electricity capacity expansion plan from GCAM-USA in the format utilized by CERF. License: BSD 2-Clause, see LICENSE and DISCLAIMER files """ def gcam_cerf_expansion(a, b): """Generate an electricity capacity expansion plan from GCAM-USA in the format utilized by CERF.""" ...
n = int(input()) c = int(input()) numbers = [] for i in range(n): numbers.append(int(input())) if sum(numbers) < c: print("IMPOSSIBLE") else: while sum(numbers) > c: numbers[numbers.index(max(numbers))] -= 1 for number in sorted(numbers): print(number)
def change(age,*som): print(age) for i in som: print(i) return change(12,'name','year','mon','address') change('a1','b1') change('a2','b2',11)
FreeMono18pt7bBitmaps = [ 0x27, 0x77, 0x77, 0x77, 0x77, 0x22, 0x22, 0x20, 0x00, 0x6F, 0xF6, 0xF1, 0xFE, 0x3F, 0xC7, 0xF8, 0xFF, 0x1E, 0xC3, 0x98, 0x33, 0x06, 0x60, 0xCC, 0x18, 0x04, 0x20, 0x10, 0x80, 0x42, 0x01, 0x08, 0x04, 0x20, 0x10, 0x80, 0x42, 0x01, 0x10, 0x04, 0x41, 0xFF, 0xF0, 0x44, 0x02, 0x10, 0x...
def intervalIntersection(A, B): aIndex = 0 bIndex = 0 toReturn = [] arg1 = A[aIndex] arg2 = B[bIndex] flag = True def compareArrs(aArr, bArr): signifyInd = "" zipComp = zip(aArr, bArr) compList = list(zipComp) lowIntSec = max(compList[0]) highIntSec...
"""Hackerrank Problem: https://www.hackerrank.com/challenges/is-binary-search-tree/problem For the purposes of this challenge, we define a binary tree to be a binary search tree with the following ordering requirements: * The data value of every node in a node's left subtree is less than the data value of that node. ...
def test_no_metrics(run): tracking = run.tracking metrics = run.dict.pop("metrics") tracking.on_epoch_end(run) run.set(metrics=metrics)
"""Top-level package for copyany.""" __author__ = """Natan Bro""" __email__ = 'code@natanbro.com' __version__ = '0.1.0'
# -*- coding: utf-8 -*- VERSION_MAJOR = 0 VERSION_MINOR = 0 VERSION_MICRO = 4 VERSION = (VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO) VERSION_STR = '.'.join(map(str, VERSION))
#!/usr/bin/env python3 def fibs(): fib1, fib2 = 1, 1 while True: yield fib1 fib1, fib2 = fib2, fib1 + fib2 print(next(i for (i, f) in enumerate(fibs(), 1) if len(str(f)) == 1000))
""" Given a list of integers and a number K, return which contiguous elements of the list sum to K. """ inp = [1,2,3,4,5] K = 9 def contiguous_sum(arr: list, k: int): start_index = 0 end_index = -1 current_sum = 0 for i in range(len(arr)): if current_sum < k: current_sum += arr[i] ...
# Copyright 2018 Tensorforce Team. 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...
#-*-coding: utf-8 -*- ''' Base cache Adapter object. ''' class BaseAdapter(object): db = None def __init__(self, timeout = -1): self.timeout = timeout def get(self, key): raise NotImplementedError() def set(self, key, value): raise NotImplementedError() def remove(self, key): raise NotImplementedError(...
# coding : utf-8 print("\n \n \n \n \n \n Belo Horizonte, 05/06/2020, 17:34.\n Você está andando na sua casa normalmente indo tomar banho, acabado o banho quando você sai do box você tropeça e cai e bate a cabeça na pia. \n Você acorda no hospital e você é uma enfermeira nossa frente.") x = input("\n Você pode ...
def repeated_word(string): # separate the string string = string.split(' ') separated_string = [] for word in string: if word not in separated_string: separated_string.append(word) for word in range(0, len(separated_string)): print(separated_string[word], 'a...
#Algorythm: Quicksort (sometimes called partition-exchange sort) #Description: In this file we are using the Hoare partition scheme, #you can seen other implementation in the other quicksort files #Source link: I saw the algorithm explanation on https://en.wikipedia.org/wiki/Quicksort #Use: It is used to sort, it is a ...
GET_ALL_GENRES = """ SELECT name FROM genres """ INSERT_GENRE = """ INSERT INTO genres (name) VALUES (:name) """
def admin_helper(admin) -> dict: return { "id": str(admin['_id']), "fullname": admin['fullname'], "email": admin['email'], } def state_count_helper(state_count) -> dict: return { "id": str(state_count['_id']), "date": state_count['date'], "state": state_count...
def get_strings(city): city = city.lower().replace(" ", "") ans = [""] * 26 order = "" for i in city: if i not in order: order += i for i in city: ans[ord(i) - 97] += "*" return ",".join([i + ":" + ans[ord(i) - 97] for i in order]) print(get_strings("Chicago"))
n,a,b = map(int,input().split()) x = list(map(int,input().split())) answer = 0 for i in range(1, n): if a*(x[i]-x[i-1]) < b: answer += a*(x[i]-x[i-1]) else: answer += b print(answer)
# address of mongoDB MONGO_SERVER = 'mongodb://192.168.1.234:27017/' # MONGO_SERVER = 'mongodb://mongodb.test:27017/' SCHEDULER_DB = "scheduler" JOB_COLLECTION = "jobs" REGISTRY_URL = "registry.zilliz.com/milvus/milvus" IDC_NAS_URL = "//172.16.70.249/test" DEFAULT_IMAGE = "milvusdb/milvus:latest" SERVER_HOST_DEFAULT...
def selection_sort(arr, simulation=False): """ Selection Sort Complexity: O(n^2) ##------------------------------------------------------------------- """ iteration = 0 if simulation: print("iteration", iteration, ":", *arr) for i in range(len(arr)): minimum = i for...
src = Split(''' tls_test.c ''') component = aos_component('tls_test', src) component.add_comp_deps('security/mbedtls')
#Задача 3. Вариант 24 #Напишите программу, которая выводит имя "Максимилиан Гольдман", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире. #Semyenov A.N.Ы #08.03.2016 print("Сегодня речь пойдёт про Максимилиана Гольдмана") print("...
NC_READ_REQUEST = 0 NC_READ_REPLY = 1 NC_HOT_READ_REQUEST = 2 NC_WRITE_REQUEST = 4 NC_WRITE_REPLY = 5 NC_UPDATE_REQUEST = 8 NC_UPDATE_REPLY = 9
""" string_util.py Miscellaneous string processing functions """ def title_case(sentence): """ Capitalize the first letter of every word in a sentence. Parameters ---------- sentence: string Sentence to be converted to title case Returns ------- result: string Input string ...
""" Hello we are attempting to simulate the cochlea. The cochlea uses a concept called tonotopy i.e. low frequencies are processed at the apex and high frequencies are processed at the base. Furthermore sound travels to its point of transduction as a traveling wave """ def __self_description(): print("Simulation ...
__author__ = 'olga' def scatterhist(ax, x, y): """ Create a scatterplot with histogram of the marginals, as in scatterhist() in Matlab but nicer. @param ax: @type ax: @param x: @type x: @param y: @type y: @return: hist_patches, scatter_points @rtype: matplotlib. """ ...
with open('input.txt') as f: input = f.readline() input = input.strip().split('-') input_min = int(input[0]) input_max = int(input[1]) def pwd_to_digits(pwd): digits = [] pwd_str = str(pwd) while len(pwd_str) > 0: digits.append(int(pwd_str[0])) pwd_str = pwd_str[1:] return digi...
class DrawflowNodeBase: def __init__(self): self.nodename = "basenode" self.nodetitle = "Basenode" self.nodeinputs = list() self.nodeoutputs = list() self.nodeicon = "" self.nodehtml = "<b>DO NOT USE THE BASE NODE!!!</b>" def name(self, name): self.nodena...
f = open("Files/Test.txt", mode="rt",encoding="utf-8") g = open("Files/fil1.txt", mode="rt",encoding="utf-8") h = open("Files/wasteland.txt", mode="rt",encoding="utf-8") # return type of read() method is str # To read specific number of character we have to pass the characters as arguments # print(f.read(25)) # To re...
# -*- coding: utf-8 -*- """Unit test package for django-model-cleanup.""" # Having tests in a separate folder is a safe choice # You can have them mixed in the src but at some point you will get # problems with test discovery activating lazy objects and other import time # headaches. And if you fail to filter test du...
class Solution: def decompressRLElist(self, nums: List[int]) -> List[int]: ret = [] i = 0 while i < len(nums): j = 0 while j < nums[i]: ret.append(nums[i+1]) j += 1 i += 2 return ret
# Given an array of numbers, find all the # pairs of numbers which sum upto `k` def find_pairs(num_array, k): pairs_array = [] for num in num_array: if (k - num) in num_array: pairs_array.append((num, (k - num))) return pairs_array result = find_pairs([0, 14, 0, 4, 7, 8, 3, 5, 7], 11...
class Solution: def champagneTower(self, poured: int, query_row: int, query_glass: int) -> float: filled = [[0.0] * (query_row + 2) for _ in range (query_row+2)] filled[0][0] = poured for row in range(query_row + 1): for col in range(query_row + 1): if (filled[ro...
""" link: https://leetcode.com/problems/linked-list-random-node problem: 对链表随机返回节点,要求 O(1) 级别的空间复杂度 solution: 统计长度,随机位置 solution-fix: 仅遍历一次,对当前第i个元素,有 1/i 的机率保留作为返回结果。需要多次随机,但只需要一次遍历。 """ # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next ...
class Headers: X_VOL_TENANT = "x-vol-tenant"; X_VOL_SITE = "x-vol-site"; X_VOL_CATALOG = "x-vol-catalog"; X_VOL_MASTER_CATALOG = "x-vol-master-catalog"; X_VOL_SITE_DOMAIN = "x-vol-site-domain"; X_VOL_TENANT_DOMAIN = "x-vol-tenant-domain"; X_VOL_CORRELATION = "x-vol-correlation"; X_VOL_HMAC_SHA256 = "x-vol-hmac-...
# -*- coding: utf-8 -*- """ Yet another static site generator. """
''' Exercise 2: Write a function save_list2file(sentences, filename) that takes two parameters, where sentences is a list of string, and filename is a string representing the name of the file where the content of sentences must be saved. Each element of the list sentences should be written on its own line in the file f...
class Solution: def uniquePathsWithObstacles(self, grid: List[List[int]]) -> int: if grid[0][0] == 1: return 0 m = len(grid) n = len(grid[0]) grid[0][0] = 1 for i in range(1, m): if grid[i][0] == 0: grid[i][0] = grid[i - 1][0] else: ...
def categorical_cross_entropy(y_pred, y): x = np.multiply(y, np.log(y_pred)) loss = x.sum() return loss
largest = None smallest = None while True: num = input("Enter a number: ") if num == "done": break try: inp=float(num) except: print("Invalid input") if smallest is None: smallest=inp elif inp < smallest: smallest=inp elif inp>largest...
""" Copyright (c) 2018-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. """ class BadConfigError(Excep...
class Solution: def numTilePossibilities(self, tiles: str) -> int: def dfs(counterMap): currentSum = 0 for char in counterMap: if counterMap[char] > 0: currentSum += 1 counterMap[char] -= 1 currentSum += dfs(...
user1 = { "user": { "username": "akram", "email": "akram.mukasa@andela.com", "password": "Akram@100555" } } login1 = {"user": {"email": "akram.mukasa@andela.com", "password": "Akram@100555"}}
# Copyright (c) Jeremías Casteglione <jrmsdev@gmail.com> # See LICENSE file. __all__ = ['configure'] def configure(env, cfg): env.settings.merge(cfg, 'service.munin_node', ( 'config.dir', 'target.dir', 'prune.plugins', ))
class Image: def __init__(self, name): self.name = name def register(self): raise NotImplementedError def getImg(self): raise NotImplementedError
expected_output = { "five_sec_cpu_total": 13, "five_min_cpu": 15, "one_min_cpu": 23, "five_sec_cpu_interrupts": 0, }
alg.aggregation ( [ "c_custkey", "c_name", "c_acctbal", "c_phone", "n_name", "c_address", "c_comment" ], [ ( Reduction.SUM, "rev", "revenue" ) ], alg.map ( "rev", scal.MulExpr ( scal.AttrExpr ( "l_extendedprice" ), scal.SubExpr ( scal.ConstExpr ( "1....
# -*- coding: utf-8 -*- """ """ def get_ratios(L1, L2): """ Assumes: L1 and L2 are lists of equal length of numbers Returns: a list containing L1[i]/L2[i] """ ratios = [] for index in range(len(L1)): try: ratios.append(L1[index]/float(L2[index])) except ZeroDivisionErro...
""" Exceptions to be called by service check plugins when the appropriate situations arrive. None of these have special behaviour. """ class ParamError(Exception): """To be thrown when user input causes the issue""" pass class ResultError(Exception): """To be thrown when the API/Metric Check returns eit...
class TracardiException(Exception): pass class StorageException(TracardiException): pass class ExpiredException(TracardiException): pass class UnauthorizedException(TracardiException): pass
def precedence(op): if op == '^': return 3 if op == '+' or op == '-': return 1 if op == '*' or op == '/': return 2 return 0 def applyOp(a, b, op): if op == '^': return a ** b if op == '+': return a + b if op == '-': return a - b if op == '*': return a * ...
""" Question 15 : Write a program that computes the values of a+aa+aaa+aaaa with a given digit as the value of a. Suppose the following input is supplied to the program : 9 Then, the output should be : 11106 Hints : In case of input data begin supplied to the question, it should be assumed to b...
class LRG(object): def __init__(self, N, V, P, S, H, end='.'): self.nonterm = set(N) self.term = set(V) self.term.add('ε') self.prod = {} for lhs, rhs in P.items(): self.prod[lhs] = set() for part in rhs.split('|'): if len(part) > 0: ...
class ControlSys(): def __init__(self, fig, imdis, vol_tran, vol_fron, vol_sagi, ax_tran, ax_fron, ax_sagi): self.fig =fig self.imdis = imdis self.vol_tran = vol_tran self.vol_fron = vol_fron self.vol_sagi = vol_sagi self.ax_tran = ax_tran self.a...
s = input() words = ["dream", "dreamer", "erase", "eraser"] words = sorted(words, reverse=True) print() for word in words: if word in s: s = s.replace(word, "") if not s: ans = "YES" else: ans = "NO" print(ans)
def read_safeguard_sql(cluster_descr, host_type): for schemas_descr in cluster_descr.schemas_list: if schemas_descr.schemas_type != host_type: continue safeguard_descr = schemas_descr.safeguard if safeguard_descr is None: continue yield from safeguard_descr...
def name_printer(user_name): print("Your name is", user_name) name = input("Please enter your name: ") name_printer(name)
error_code = { "private_account": [179, "Kalau mau ngemock pikir-pikir juga dong, masa private akun, mana keliatan tweetnya "], "blocked_account": [136, "Botnya dah diblock sama {}, ah ga seru"], "duplicate_tweet": [187, "Duplicated tweet"], "tweet_target_deleted": [144, "Tweetnya udah dihapus, kasian d...
# <auto-generated> # This code was generated by the UnitCodeGenerator tool # # Changes to this file will be lost if the code is regenerated # </auto-generated> def to_millilitres(value): return value * 4546.091879 def to_litres(value): return value * 4.546091879 def to_kilolitres(value): return value * 0.0045460...
# -*- coding: utf-8 -*- ''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) ''' __func_alias__ = { 'reload_': 'reload' } def __virtual__(): ''' Only work on systems which default to SMF ''' # Don't let this work on Solaris 9 since SMF doesn'...
n = int(input()) a = set(map(int, input().split())) m = int(input()) b = set(map(int, input().split())) inx = a.intersection(b) unx = a.union(b) x = unx.difference(inx) for i in sorted(x): print(i)
class Simulation: def __init__(self, x, v, box, potentials, integrator): self.x = x self.v = v self.box = box self.potentials = potentials self.integrator = integrator
class MyClass: """ Multiline class docstring """ def method(self): """Multiline method docstring """ pass def foo(): """This is a docstring with some lines of text here """ return def bar(): '''This is another docstring with more lines of text ''' return def b...
# Hola 3 -> HolaHolaHola def repeticiones(n):#Funcion envolvente def repetidor(string):#funcion anidada assert type(string) == str, "Solo se pueden utilizar strings" #afirmamos que el valor ingresado es un entero, de lo contrario envia el mensaje de error return(string*n)# llama a scope superi...
DATASET = "forest-2" CLASSES = 2 FEATURES = 54 NN_SIZE = 256 DIFFICULTY = 10000
#!/usr/bin/env python3 class Case: def __init__(self, number_of_switches): self.number_of_switches = number_of_switches self.number_of_toggles = 0 def run(self): self.number_of_toggles = self.min_toggles_for(self.number_of_switches) def min_toggles_for(self, switches): ""...
nome = input('Digite seu nome: ') cpf = input('Digite seu CPF: ') rg = input('Digite seu RG: ') msg = '{0}, seu CPF é {1} e seu RG é {2}' print(msg.format(nome,cpf,rg))
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Schooner - Course Management System # University of Turku / Faculty of Technilogy / Department of Computing # (c) 2021, Jani Tammi <jasata@utu.fi> # # Submission.py - Data dictionary class for core.submission # 2021-08-27 Initial version. # 2021-09-03 Updated to ...
# -*- coding: utf-8 -*- def get_node_indice(self, coordinates=None): """Return a matrix of nodes coordinates. Parameters ---------- self : Mesh an Mesh object indices : list Indices of the targeted nodes. If None, return all. is_indice: bool Option to return the nodes ...
class ContainerHypervisor(): def __init__(self): self.data = {} def parse(self, verbose=True): assert False, "Please use a subclass the implements this method." def retrieve_inputs(self, inputs, *args): assert False, "Please use a subclass the implements this method." def upl...
class ImportError(Exception): pass class CatalogueImportError(Exception): pass
class Solution: def numberToWords(self, num: int) -> str: LESS_THAN_20 = ["", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", ...
a = int(input()) b = int(input()) if(a > b): print(True) else: print(False)
class X: pass class Y: pass class Z: pass class A(X, Y): pass class B(Y, Z): pass class M(B, A, Z): pass # Output: # [<class '__main__.M'>, <class '__main__.B'>, # <class '__main__.A'>, <class '__main__.X'>, # <class '__main__.Y'>, <class '__main__.Z'>, # <class 'object'>] print(M.mro())
#Its a simple Rock paper scissor game print('...Rock...') print('...Paper...') print('...Scissor...') x = input('Enter Player 1 Choice ') print('No Cheating\n\n' * 20) y = input('Enter Play 2 Choice ') if x == 'paper' and y == 'rock': print('Player 1 won') elif x == 'rock' and y == 'paper': print('Player 2 wins') eli...
# Python - 3.6.0 def solution(a, b): units = { 'g': 1e-3, 'mg': 1e-6, 'μg': 1e-9, 'lb': 0.453592, 'cm': 1e-2, 'mm': 1e-3, 'μm': 1e-6, 'ft': 0.3048 } m1, m2, r = [*map(lambda e: e[0] * units.get(e[1], 1), zip(a, b))] return 6.67e-11 * m1 * ...
POINT = 30 ochki = 30 person = {"Сила":"0","Здоровье":"0","Мудрость":"0","Ловкость":"0"} points = 0 choice = None while choice != 0: print(""" 0 - Выход 1 - Добавить пункты к характеристике 2 - Уменьшить пункты характеристики 3 - Просмотр характеристик """) choice = int(input("Выбор пункта меню: ")) if...
def add(x,y): """Add two numer together""" return x + y def substract(x,y): """Substract x from y and return value """ return y - x
# Program 70 : Function to print binary number using recursion def convertToBinary(n): if n > 1: convertToBinary(n//2) print(n % 2,end = '') # decimal number dec = int(input("Enter Decimal Number : ")) convertToBinary(dec) print()
def to_celsius(kelvin:float, round_digit=2) -> float: """Convert Kelvin to Celsius Args: kelvin (float): round_digit (int, optional): Defaults to 2. Returns: float: celcius """ return round(kelvin-273.15, round_digit) def fahr_to_celsius(fahr): cel=(fahr-32)*(5...
buffet = ('beef', 'chicken', 'fish', 'pork', 'lamb') for item in buffet: print(item, end=" ") print() buffet = ('wagyu', 'chicken', 'fish', 'squid', 'lamb') for item in buffet: print(item, end=" ")
''' Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1: Input: nums = [2,7,11,15]...
SQLALCHEMY_DATABASE_URI = \ 'postgres+psycopg2://postgres:postgres@172.16.100.140/tdt2018' # 'postgres+psycopg2://postgres:postgres@localhost/tdt2018' SECRET_KEY = '\x88D\xf09\x91\x07\x98\x89\x87\x96\xa0A\xc68\xf9\xecJ:U\x17\xc5V\xbe\x8b\xef\xd7\xd8\xd3\xe6\x98*4'
#!/usr/bin/env python3 # # author : Michael Brockus.   # contact: <mailto:michaelbrockus@gmail.com> # license: Apache 2.0 :http://www.apache.org/licenses/LICENSE-2.0 # # copyright 2020 The Meson-UI development team # info = '''\ Meson-UI is an open source build GUI meant to be both extremely fast, and, even more imp...
class Node(): def __init__(self, key, cor): self._p = None self._right = None self._key = key self._left = None self._cor = cor def get_cor(self): return self._cor def set_cor(self, valor): self._cor = valor def get_key(self): return sel...
class Source(object): """Source is a data source capable of fetching and rendering data. To create your own custom data source, you should subclass this class and override it with your own fetch() and render() functions. aiohttp is provided to all Source classes to fetch data over HTTP. See httpc...
""" Implementation of EDA-specific components """ def mk_clock(ctx, name): """ Creates a clock signal """ bool_t = ctx.mk_boolean_type() i = ctx.mk_input(name + '_input', bool_t) first = ctx.mk_latch(name + '_first', bool_t) ctx.set_latch_init_next(first, ctx.mk_true(), ctx.mk_false()) ...
word_to_find = "box" def get_puzzle(): o = [] with open("puzzle.txt","r") as file: x = file.readlines() for i in x: o.append(i.split(",")[:-1]) return o def chunks(lst, n): f = [] for i in range(0, len(lst), n): f.append(lst[i:i + n]) return f def find_letters_in_list(lst,word): ...
dataset_paths = { # Face Datasets (In the paper: FFHQ - train, CelebAHQ - test) 'ffhq': '', 'celeba_test': '', # Cars Dataset (In the paper: Stanford cars) 'cars_train': '', 'cars_test': '', # Horse Dataset (In the paper: LSUN Horse) 'horse_train': '', 'horse_test': '', # Church Dataset (In the paper: ...
class Stop(): def __init__(self, name): self.name = name self.schedule = {} self.previous_stop = dict() self.next_stop = dict() self.neighbords = [self.previous_stop, self.next_stop] self.left_stop = None self.right_stop = None def set_schedule(self, line, schedule): self.schedule[line] = schedule ...
def sum_of_two_numbers(number_1, number_2): return number_1 + number_2 #print(sum(5,6)) if __name__ == '____': a, b= map(int, input().split()) print(sum(a, b))
#from DebugLogger00110 import DebugLogger00100 #import fbxsdk as fbx #from fbxsdk import * #import fbx as fbxsdk #from fbx import * # -*- coding: utf-8 -*- #from fbx import * #import DebugLogger00100 #import DebugLogger00100 #import WriteReadTrans_Z_00310 #import GetKeyCurve00110 #===================class Node=========...
''' Exercício Python 015: Escreva um programa que pergunte a quantidade de Km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0,15 por Km rodado. ''' dias = int(input('Quantos dias alugados? ')) km = float(input...