content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# How to merge two dicts x = {'a': 1, 'b': 2} y = {'c': 3, 'd': 4} z = {**x, **y} print(z)
x = {'a': 1, 'b': 2} y = {'c': 3, 'd': 4} z = {**x, **y} print(z)
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/xavier_ssd/TrekBot/TrekBot2_WS/src/navigation/nav_core/include".split(';') if "/xavier_ssd/TrekBot/TrekBot2_WS/src/navigation/nav_core/include" != "" else [] PROJECT_CATKIN_DEPENDS = "std_msgs;geometr...
catkin_package_prefix = '' project_pkg_config_include_dirs = '/xavier_ssd/TrekBot/TrekBot2_WS/src/navigation/nav_core/include'.split(';') if '/xavier_ssd/TrekBot/TrekBot2_WS/src/navigation/nav_core/include' != '' else [] project_catkin_depends = 'std_msgs;geometry_msgs;tf2_ros;costmap_2d'.replace(';', ' ') pkg_config_l...
#!/usr/bin/env python # coding: utf-8 # In[9]: for i in range(int(input())) : print('Distances: ', end='') X,Y = input().split() Z = zip(X, Y) for S in Z : x = ord(S[0]) - ord('A') + 1 y = ord(S[1]) - ord('A') + 1 if x <= y : print(y-x, end= ' ') else : ...
for i in range(int(input())): print('Distances: ', end='') (x, y) = input().split() z = zip(X, Y) for s in Z: x = ord(S[0]) - ord('A') + 1 y = ord(S[1]) - ord('A') + 1 if x <= y: print(y - x, end=' ') else: print(y + 26 - x, end=' ') print()
# from sw_site.settings.components import BASE_DIR, config # SECURITY WARNING: keep the secret key used in production secret! # SECRET_KEY = config('DJANGO_SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True CORS_ORIGIN_WHITELIST = ( 'localhost:8000', '127.0.0.1:8000',...
debug = True cors_origin_whitelist = ('localhost:8000', '127.0.0.1:8000', 'localhost:8080', '127.0.0.1:8080')
def get_context_user(context): if 'user' in context: return context['user'] elif 'request' in context: return getattr(context['request'], 'user', None)
def get_context_user(context): if 'user' in context: return context['user'] elif 'request' in context: return getattr(context['request'], 'user', None)
APP_NAME = "PythonCef.Vue.Vuetify2 Template" APP_NAME_NO_SPACE = APP_NAME.replace(' ', '') APP_VERSION = '0.0.1' APP_DESCRIPTION = "Template using PythonCef, Flask, Vue, webpack"
app_name = 'PythonCef.Vue.Vuetify2 Template' app_name_no_space = APP_NAME.replace(' ', '') app_version = '0.0.1' app_description = 'Template using PythonCef, Flask, Vue, webpack'
def count_substring(string, sub_string): c = 0 for i in range(0, len(string)): ss = string[i:len(sub_string)+i] if sub_string == ss: c += 1 return c print(count_substring('ABCDCDC', 'CDC')) print(count_substring('I am an Indian, by birth', 'Birth')) print(count_substring('Th...
def count_substring(string, sub_string): c = 0 for i in range(0, len(string)): ss = string[i:len(sub_string) + i] if sub_string == ss: c += 1 return c print(count_substring('ABCDCDC', 'CDC')) print(count_substring('I am an Indian, by birth', 'Birth')) print(count_substring('ThIsi...
a=int(input("Input an integer :")) n1=int("%s"%a) n2=int("%s%s"%(a,a)) n3=int("%s%s%s"%(a,a,a)) print(n1+n2+n3)
a = int(input('Input an integer :')) n1 = int('%s' % a) n2 = int('%s%s' % (a, a)) n3 = int('%s%s%s' % (a, a, a)) print(n1 + n2 + n3)
class Solution: def hasPathSum(self, root, target): def check(curr_node, curr_val): calc_val = curr_val + curr_node.val if calc_val == target and curr_node.left is None and curr_node.right is None: return True elif curr_node.left is not None and check(curr...
class Solution: def has_path_sum(self, root, target): def check(curr_node, curr_val): calc_val = curr_val + curr_node.val if calc_val == target and curr_node.left is None and (curr_node.right is None): return True elif curr_node.left is not None and chec...
##Patterns: W0109 ##Warn: W0109 cities = { 'CA': 'San Francisco', 'MI': 'Detroit', 'FL': 'Jacksonville', 'MI': 'Detroit' }
cities = {'CA': 'San Francisco', 'MI': 'Detroit', 'FL': 'Jacksonville', 'MI': 'Detroit'}
matriz = ([0,0,0], [0,0,0], [0,0,0]) par = terceira = maior = 0 for l in range(0,3): for c in range(0,3): matriz[l][c] = int(input(f'Type a value for [{l}, {c}]: ')) if matriz[l][c] % 2 == 0: par += matriz[l][c] print('=-'*15) for l in range (0,3): for c in range(0,3): print(...
matriz = ([0, 0, 0], [0, 0, 0], [0, 0, 0]) par = terceira = maior = 0 for l in range(0, 3): for c in range(0, 3): matriz[l][c] = int(input(f'Type a value for [{l}, {c}]: ')) if matriz[l][c] % 2 == 0: par += matriz[l][c] print('=-' * 15) for l in range(0, 3): for c in range(0, 3): ...
class Constant: __excludes__ = [] class ConstantError(Exception): pass def __setattr__(self, name, value): exclude = name in Constant.__excludes__ if self.__dict__.get(name, None) and not exclude: raise Constant.ConstantError("Property %s is not mutable" % name) ...
class Constant: __excludes__ = [] class Constanterror(Exception): pass def __setattr__(self, name, value): exclude = name in Constant.__excludes__ if self.__dict__.get(name, None) and (not exclude): raise Constant.ConstantError('Property %s is not mutable' % name) ...
even = int(input("total even number : ")) print(even, "first even number : ",end="") for i in range(2,even*2,2): print (i,end=", ") print(even*2)
even = int(input('total even number : ')) print(even, 'first even number : ', end='') for i in range(2, even * 2, 2): print(i, end=', ') print(even * 2)
__all__ = ["mi_enb_decoder"] PACKET_TYPE = { "0xB0A3": "LTE_PDCP_DL_Cipher_Data_PDU", "0xB0B3": "LTE_PDCP_UL_Cipher_Data_PDU", "0xB173": "LTE_PHY_PDSCH_Stat_Indication", "0xB063": "LTE_MAC_DL_Transport_Block", "0xB064": "LTE_MAC_UL_Transport_Block", "0xB092": "LTE_RLC_UL_AM_All_PDU", "0xB082": "LTE_RLC_D...
__all__ = ['mi_enb_decoder'] packet_type = {'0xB0A3': 'LTE_PDCP_DL_Cipher_Data_PDU', '0xB0B3': 'LTE_PDCP_UL_Cipher_Data_PDU', '0xB173': 'LTE_PHY_PDSCH_Stat_Indication', '0xB063': 'LTE_MAC_DL_Transport_Block', '0xB064': 'LTE_MAC_UL_Transport_Block', '0xB092': 'LTE_RLC_UL_AM_All_PDU', '0xB082': 'LTE_RLC_DL_AM_All_PDU', '...
# Python - 2.7.6 eval_object = lambda v: { '+': v['a'] + v['b'], '-': v['a'] - v['b'], '/': v['a'] / v['b'], '*': v['a'] * v['b'], '%': v['a'] % v['b'], '**': v['a'] ** v['b'] }.get(v['operation'], 0)
eval_object = lambda v: {'+': v['a'] + v['b'], '-': v['a'] - v['b'], '/': v['a'] / v['b'], '*': v['a'] * v['b'], '%': v['a'] % v['b'], '**': v['a'] ** v['b']}.get(v['operation'], 0)
frase = str(input('Digite uma frase: ')) m5 = ' '.join(frase.replace(' ', '')) print(m5.split())
frase = str(input('Digite uma frase: ')) m5 = ' '.join(frase.replace(' ', '')) print(m5.split())
# varia class Sleep: def NREM(self): print('NREM') def REM(self): print('REM') class Awake: def act(self): print('act')
class Sleep: def nrem(self): print('NREM') def rem(self): print('REM') class Awake: def act(self): print('act')
#Init records_storage = dict() line_break = "-----------------------------------------------\n" run_program = True # Define Functions def add_item(key, value): records_storage[key] = value def delete_item(key): try: del records_storage[key] except KeyError: print(f"Key '{key}' could not be f...
records_storage = dict() line_break = '-----------------------------------------------\n' run_program = True def add_item(key, value): records_storage[key] = value def delete_item(key): try: del records_storage[key] except KeyError: print(f"Key '{key}' could not be found") except: ...
def example1(): g = ig.load("data/out_1.graphml") # whichever file you would like dend = g.community_fastgreedy() #get the clustering object c = dend.as_clustering() result = metrics.run_analysis(c) print(c)
def example1(): g = ig.load('data/out_1.graphml') dend = g.community_fastgreedy() c = dend.as_clustering() result = metrics.run_analysis(c) print(c)
class Player(object): def __init__(self): self.name = None self.results = dict() self.rolls = [] self.scores = dict() # # set pins scores for a frame. # def set_result(self, frame, result): self.results[frame] = result def calculate_scor...
class Player(object): def __init__(self): self.name = None self.results = dict() self.rolls = [] self.scores = dict() def set_result(self, frame, result): self.results[frame] = result def calculate_score(self): running_total = 0 for (frame, result) ...
#--------------------------------- # BATCH DEFAULTS #--------------------------------- # The default options applied to each stage in the shell script. These options # are overwritten by the options provided by the individual stages in the next # section. # Stage options which Rubra will recognise are: # - distribute...
stage_defaults = {'distributed': True, 'walltime': '01:00:00', 'memInGB': 4, 'queue': 'main', 'modules': ['perl/5.18.0', 'java/1.7.0_25', 'samtools-intel/0.1.19', 'python-gcc/2.7.5', 'fastqc/0.10.1', 'bowtie2-intel/2.1.0', 'tophat-gcc/2.0.8', 'cufflinks-gcc/2.1.1', 'bwa-intel/0.7.5a'], 'manager': 'slurm'} stages = {'ma...
class Diamond: START_LETTER = 'A' ENTER = '\n' SPACE = ' ' BLANK = '' def __init__(self, upTo): self.upTo = upTo def show(self): top = self.BLANK bottom = self.BLANK for c in range(ord(self.START_LETTER), ord(self.upTo)+1): line = self....
class Diamond: start_letter = 'A' enter = '\n' space = ' ' blank = '' def __init__(self, upTo): self.upTo = upTo def show(self): top = self.BLANK bottom = self.BLANK for c in range(ord(self.START_LETTER), ord(self.upTo) + 1): line = self.buildLine(ch...
# https://docs.google.com/document/d/1Ljm9S29J-mFOZ3fwrkGohMDrn9fORVteWjzucuZfyaM/edit?usp=sharing # Huu Hung Nguyen # 12/12/2021 # Nguyen_HuuHung_accounts.py # The program stores the Account class, the SavingAccount class, and # the CreditCardAccount class. class Account: ''' Account class for representing and ...
class Account: """ Account class for representing and manipulating number, balance coordinates. """ def __init__(self, number, balance): """ Create a new point at the given coordinates. """ self.number = number self.balance = balance def __str__(self): """ Display t...
path = "data/DataPoints.txt" lines_path = "data/lines.txt" index_and_slope_delim = ';' slope_and_intercept_delim = ":" delim = ","
path = 'data/DataPoints.txt' lines_path = 'data/lines.txt' index_and_slope_delim = ';' slope_and_intercept_delim = ':' delim = ','
routers = dict( BASE = dict( default_application = "webremote", default_controller = "webremote", default_function = "index", ) )
routers = dict(BASE=dict(default_application='webremote', default_controller='webremote', default_function='index'))
# # PySNMP MIB module BIANCA-BRICK-TOKEN-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BIANCA-BRICK-TOKEN-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:21:46 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (d...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, constraints_intersection, constraints_union, value_range_constraint) ...
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' def evalFile(f1, f2): op = open(f1) plain = op.read() op.close() op = open(f2) imperfect = op.read() op.close() list1 = [] list2 = [] for letter in plain: if letter.upper() in LETTERS: if letter.upper() not in list1: ...
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' def eval_file(f1, f2): op = open(f1) plain = op.read() op.close() op = open(f2) imperfect = op.read() op.close() list1 = [] list2 = [] for letter in plain: if letter.upper() in LETTERS: if letter.upper() not in list1: ...
''' You work for an airline, and your manager has asked you to do a competitive analysis and see how often passengers flying on other airlines are involuntarily bumped from their flights. You got a CSV file (airline_bumping.csv) from the Department of Transportation containing data on passengers that were involuntarily...
""" You work for an airline, and your manager has asked you to do a competitive analysis and see how often passengers flying on other airlines are involuntarily bumped from their flights. You got a CSV file (airline_bumping.csv) from the Department of Transportation containing data on passengers that were involuntarily...
# LIFO Stack DS using Python Lists (Arrays) class StacksArray: def __init__(self): self.stackArray = [] def __len__(self): return len(self.stackArray) def isempty(self): return len(self.stackArray) == 0 def display(self): print(self.stackArray) def top(self):...
class Stacksarray: def __init__(self): self.stackArray = [] def __len__(self): return len(self.stackArray) def isempty(self): return len(self.stackArray) == 0 def display(self): print(self.stackArray) def top(self): return self.stackArray[-1] def pop...
class ClassDictionary: def __init__(self, value): self.dict_value = value def __getattribute__(self, name): if name == "dict_value": return super().__getattribute__(name) result = self.dict_value.get(name) return result def __setattr__(self, name, value): ...
class Classdictionary: def __init__(self, value): self.dict_value = value def __getattribute__(self, name): if name == 'dict_value': return super().__getattribute__(name) result = self.dict_value.get(name) return result def __setattr__(self, name, value): ...
# String Rotation: Assume you have a method isSubstringwhich checks if one word is a substring # of another. Given two strings, sl and s2, write code to check if s2 is a rotation of sl using only one # call to isSubstring (e.g., "waterbottle" is a rotation of "erbottlewat") def is_substring(s1, s2): return s2 in s...
def is_substring(s1, s2): return s2 in s1 def is_string_rotation(s1, s2): if not len(s1) == len(s2): return False double_s1 = s1 + s1 return is_substring(double_s1, s2) print(is_string_rotation('waterbottle', 'erbottlewat'))
__author__ = 'fabian' __all__ = ['handler']
__author__ = 'fabian' __all__ = ['handler']
class AccountNotFoundError(Exception): pass class TransactionError(Exception): pass class AccountClosedError(TransactionError): pass class InsufficientFundsError(TransactionError): pass
class Accountnotfounderror(Exception): pass class Transactionerror(Exception): pass class Accountclosederror(TransactionError): pass class Insufficientfundserror(TransactionError): pass
text = input().split() times_seen = {} for word in text: if word not in times_seen: times_seen[word] = 0 print(times_seen[word], end=' ') times_seen[word] += 1
text = input().split() times_seen = {} for word in text: if word not in times_seen: times_seen[word] = 0 print(times_seen[word], end=' ') times_seen[word] += 1
def LeftView(root): ''' :param root: root of given tree. :return: print the left view of tree, dont print new line ''' # code here res = [] while root: res.append(root.data) if root.left: root = root.left elif root.right: root = root.right ...
def left_view(root): """ :param root: root of given tree. :return: print the left view of tree, dont print new line """ res = [] while root: res.append(root.data) if root.left: root = root.left elif root.right: root = root.right else: ...
# # PySNMP MIB module APPIAN-PPORT-SONET-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APPIAN-PPORT-SONET-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:23:54 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (d...
(ac_pport, ac_admin_status, ac_op_status, ac_slot_number, ac_port_number, ac_node_id) = mibBuilder.importSymbols('APPIAN-SMI-MIB', 'acPport', 'AcAdminStatus', 'AcOpStatus', 'AcSlotNumber', 'AcPortNumber', 'AcNodeId') (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Inte...
class Solution: def longestConsecutive(self, nums): nums_set = set(nums) longest_seq = 0 for num in nums_set: # Don't need to check if there is a - 1 smaller in the list. if num - 1 not in nums_set: current_num = num current_seq = 1 ...
class Solution: def longest_consecutive(self, nums): nums_set = set(nums) longest_seq = 0 for num in nums_set: if num - 1 not in nums_set: current_num = num current_seq = 1 while current_num + 1 in nums_set: cur...
def test(): # Here we can either check objects created in the solution code, or the # string value of the solution, available as __solution__. A helper for # printing formatted messages is available as __msg__. See the testTemplate # in the meta.json for details. # If an assertion fails, the message...
def test(): assert not numeric_cols is None, 'Your answer for numeric_cols does not exist. Have you assigned the list of labels for numeric columns to the correct variable name?' assert type(numeric_cols) == list, 'numeric_cols does not appear to be of type list. Can you store all the labels of the numeric colu...
# Section 5.16 Self Check snippets # Exercise 4 t = [[10, 7, 3], [20, 4, 17]] total = 0 items = 0 for row in t: for item in row: total += item items += 1 total / items total = 0 items = 0 for row in t: total += sum(row) items += len(row) total / items #######################...
t = [[10, 7, 3], [20, 4, 17]] total = 0 items = 0 for row in t: for item in row: total += item items += 1 total / items total = 0 items = 0 for row in t: total += sum(row) items += len(row) total / items
def minion_game(string): # your code goes here Kevin = 0 Stuart = 0 word = list(string) x = len(word) vowels = ['A','E','I','O','U'] for inx, w in enumerate(word): if w in vowels: Kevin = Kevin + x else: Stuart = Stuart + x x = x - 1 ...
def minion_game(string): kevin = 0 stuart = 0 word = list(string) x = len(word) vowels = ['A', 'E', 'I', 'O', 'U'] for (inx, w) in enumerate(word): if w in vowels: kevin = Kevin + x else: stuart = Stuart + x x = x - 1 if Stuart > Kevin: ...
no_exists = '{}_does_not_exists' already_exists = '{}_already_exists' exception_occurred = 'exception_occurred' no_modification_made = 'mo_modification_made' no_required_args = 'no_required_args' add_success = 'add_{}_success' delete_success = 'delete_{}_success' __all__ = ['no_exists', 'exception_occurred', 'no_modi...
no_exists = '{}_does_not_exists' already_exists = '{}_already_exists' exception_occurred = 'exception_occurred' no_modification_made = 'mo_modification_made' no_required_args = 'no_required_args' add_success = 'add_{}_success' delete_success = 'delete_{}_success' __all__ = ['no_exists', 'exception_occurred', 'no_modifi...
class RetrievalMethod(): def __init__(self,db): self.db = db def get_sentences_for_claim(self,claim_text,include_text=False): pass
class Retrievalmethod: def __init__(self, db): self.db = db def get_sentences_for_claim(self, claim_text, include_text=False): pass
''' WRITTEN BY Ramon Rossi PURPOSE Consider the Fionacci sequence. It is a sequence of natural numbers defined recursively as follows: * the first element is 0 * the second is 1 * each next element is the sum of the previous two elements This function will sum all even elements of the Fibona...
""" WRITTEN BY Ramon Rossi PURPOSE Consider the Fionacci sequence. It is a sequence of natural numbers defined recursively as follows: * the first element is 0 * the second is 1 * each next element is the sum of the previous two elements This function will sum all even elements of the Fibona...
def caesarCipherEncryptor(string, key): # To solve this problem, we need first to break the string into a list of chars, and then apply a function # basically transform each letter the key shifted, and then join them together. Obviously creating the list will take O(n) time and space # the function can be impleme...
def caesar_cipher_encryptor(string, key): new_letters = [] new_key = key % 26 for letter in string: newLetters.append(get_new_letter(letter, newKey)) return ''.join(newLetters) def get_new_letter(letter, key): new_letter_code = ord(letter) + key return chr(newLetterCode) if newLetterCod...
f = open("test_data.txt", "r") fout = open("test_data_commas.txt", "w") for line in f: fout.write(line.replace(" ", ",")) f.close() fout.close()
f = open('test_data.txt', 'r') fout = open('test_data_commas.txt', 'w') for line in f: fout.write(line.replace(' ', ',')) f.close() fout.close()
class Menu: def __init__(self, Requests, log, presences): self.Requests = Requests self.log = log self.presences = presences def get_party_json(self, GamePlayersPuuid, presencesDICT): party_json = {} for presence in presencesDICT: if presence["puuid"] in...
class Menu: def __init__(self, Requests, log, presences): self.Requests = Requests self.log = log self.presences = presences def get_party_json(self, GamePlayersPuuid, presencesDICT): party_json = {} for presence in presencesDICT: if presence['puuid'] in Gam...
# generated from genmsg/cmake/pkg-genmsg.context.in messages_str = "/home/suntao/workspace/gorobots/utils/real_robots/stbot/catkin_ws/src/lilistbot/msg/Jy901imu.msg" services_str = "" pkg_name = "lilistbot" dependencies_str = "std_msgs" langs = "gencpp;geneus;genlisp;gennodejs;genpy" dep_include_paths_str = "lilistbot...
messages_str = '/home/suntao/workspace/gorobots/utils/real_robots/stbot/catkin_ws/src/lilistbot/msg/Jy901imu.msg' services_str = '' pkg_name = 'lilistbot' dependencies_str = 'std_msgs' langs = 'gencpp;geneus;genlisp;gennodejs;genpy' dep_include_paths_str = 'lilistbot;/home/suntao/workspace/gorobots/utils/real_robots/st...
pirate_ship_status = [int(i) for i in input().split('>')] warship_status = [int(i) for i in input().split('>')] health_capacity = int(input()) while True: command_nosplit = input() if command_nosplit == "Retire": break command = command_nosplit.split() if "Fire" in command: index = int(...
pirate_ship_status = [int(i) for i in input().split('>')] warship_status = [int(i) for i in input().split('>')] health_capacity = int(input()) while True: command_nosplit = input() if command_nosplit == 'Retire': break command = command_nosplit.split() if 'Fire' in command: index = int(c...
class Solution(object): def findDisappearedNumbers(self, nums): return list(set(range(1,len(nums)+1)) - set(nums)) nums = [4, 6, 2, 6, 7, 2, 1] def test(): assert Solution().findDisappearedNumbers(nums) == [3, 5]
class Solution(object): def find_disappeared_numbers(self, nums): return list(set(range(1, len(nums) + 1)) - set(nums)) nums = [4, 6, 2, 6, 7, 2, 1] def test(): assert solution().findDisappearedNumbers(nums) == [3, 5]
# Copyright (c) OpenMMLab. All rights reserved. _base_ = './i_base.py' item_cfg = {'b': 2} item6 = {'cfg': item_cfg}
_base_ = './i_base.py' item_cfg = {'b': 2} item6 = {'cfg': item_cfg}
# type: ignore __all__ = [ "datatipinfo", "deprpt", "dbstep", "arrayviewfunc", "openvar", "workspace", "commandwindow", "runreport", "fixcontents", "projdumpmat", "urldecode", "renameStructField", "dbcont", "checkcode", "publish", "urlencode", "uiimpo...
__all__ = ['datatipinfo', 'deprpt', 'dbstep', 'arrayviewfunc', 'openvar', 'workspace', 'commandwindow', 'runreport', 'fixcontents', 'projdumpmat', 'urldecode', 'renameStructField', 'dbcont', 'checkcode', 'publish', 'urlencode', 'uiimport', 'dbstop', 'grabcode', 'mlintrpt', 'workspacefunc', 'dbstack', 'filebrowser', 'db...
#!/usr/bin/env python ######################################################################## # Copyright 2012 Mandiant # Copyright 2014 FireEye # # Mandiant licenses this file to you under the Apache License, Version # 2.0 (the "License"); you may not use this file except in compliance with the # License. You may obt...
description = 'SHIFT LEFT 7 and SUB used in DoublePulsar backdoor' type = 'unsigned_int' test_1 = 2493113697 def hash(data): eax = 0 edi = 0 for i in data: edi = 4294967295 & eax << 7 eax = 4294967295 & edi - eax eax = eax + (255 & i) edi = 4294967295 & eax << 7 eax = 429496...
def loop(subject: int, loop_size: int) -> int: value = 1 for i in range(loop_size): value *= subject value = value % 20201227 return value def find_loopsize(public_key: int) -> int: value = 1 subject = 7 for i in range(100_000_000): value *= subject value = valu...
def loop(subject: int, loop_size: int) -> int: value = 1 for i in range(loop_size): value *= subject value = value % 20201227 return value def find_loopsize(public_key: int) -> int: value = 1 subject = 7 for i in range(100000000): value *= subject value = value %...
def findDecision(obj): #obj[0]: Passanger, obj[1]: Weather, obj[2]: Temperature, obj[3]: Time, obj[4]: Coupon, obj[5]: Coupon_validity, obj[6]: Gender, obj[7]: Age, obj[8]: Maritalstatus, obj[9]: Children, obj[10]: Education, obj[11]: Occupation, obj[12]: Income, obj[13]: Bar, obj[14]: Coffeehouse, obj[15]: Restaurantl...
def find_decision(obj): if obj[16] > 0.0: if obj[15] > 1.0: if obj[7] <= 3: if obj[12] > 1: if obj[3] > 0: if obj[9] > 0: if obj[4] > 0: return 'False' ...
class Solution: def minDistance(self, word1: str, word2: str) -> int: m,n=len(word1),len(word2) dp=[[0 for _ in range(0,n+1)] for _ in range(0,m+1)] for _ in range(0,m+1):dp[_][0]=_ for _ in range(0,n+1):dp[0][_]=_ for i in range(1,m+1): ...
class Solution: def min_distance(self, word1: str, word2: str) -> int: (m, n) = (len(word1), len(word2)) dp = [[0 for _ in range(0, n + 1)] for _ in range(0, m + 1)] for _ in range(0, m + 1): dp[_][0] = _ for _ in range(0, n + 1): dp[0][_] = _ for i i...
a = 999 b = 999 palindromes = [] for n in range(1,1000): for m in range(1,1000): num = m*n if str(num) == str(num)[::-1]: palindromes.append(num) print(max(palindromes))
a = 999 b = 999 palindromes = [] for n in range(1, 1000): for m in range(1, 1000): num = m * n if str(num) == str(num)[::-1]: palindromes.append(num) print(max(palindromes))
def fileNaming(names): outnames = [] for name in names: if name in outnames: k = 1 while "{}({})".format(name, k) in outnames: k += 1 name = "{}({})".format(name, k) outnames.append(name) return outnames
def file_naming(names): outnames = [] for name in names: if name in outnames: k = 1 while '{}({})'.format(name, k) in outnames: k += 1 name = '{}({})'.format(name, k) outnames.append(name) return outnames
print("Hello World") print("Hello Again") print("I Like typing this") print("This is fun.") print("Yay! Printing.") print("I'd much rather you 'not'.") print('I"said" do not touch this.') print("how to fix github")
print('Hello World') print('Hello Again') print('I Like typing this') print('This is fun.') print('Yay! Printing.') print("I'd much rather you 'not'.") print('I"said" do not touch this.') print('how to fix github')
#!/usr/env/bin python # https://www.hackerrank.com/challenges/array-left-rotation # Python 2 # first_input = '5 4' # second_input = '1 2 3 4 5' first_input = raw_input() second_input = raw_input() n, d = map(lambda x: int(x), first_input.split(' ')) items = second_input.split(' ') for i in xrange(d): item = item...
first_input = raw_input() second_input = raw_input() (n, d) = map(lambda x: int(x), first_input.split(' ')) items = second_input.split(' ') for i in xrange(d): item = items.pop(0) items.append(item) print(' '.join(items))
# Reading lines from file and putting in a content string for line in open('rosalind_iev.txt', 'r').readlines(): contents = line.rsplit() AA_AA = float(contents[0]) AA_Aa = float(contents[1]) AA_aa = float(contents[2]) Aa_Aa = float(contents[3]) Aa_aa = float(contents[4]) aa_aa = float(contents[5]) def iev_p...
for line in open('rosalind_iev.txt', 'r').readlines(): contents = line.rsplit() aa_aa = float(contents[0]) aa__aa = float(contents[1]) aa_aa = float(contents[2]) aa__aa = float(contents[3]) aa_aa = float(contents[4]) aa_aa = float(contents[5]) def iev_prob(offsprings, AA_AA, AA_Aa, AA_aa, Aa_Aa, Aa_aa, aa_aa): ...
''' Represents the different HTTP status codes returned from the API to indicate errors. http://docs.veritranspay.co.id/sandbox/status_code.html ''' # 20x - successful submission to api SUCCESS = 200 # NOTE: this is returned when manually cancelled too! CHALLENGE = 201 PENDING = 201 # NOTE: returned when payment typ...
""" Represents the different HTTP status codes returned from the API to indicate errors. http://docs.veritranspay.co.id/sandbox/status_code.html """ success = 200 challenge = 201 pending = 201 expired = 202 moved_permanently = 300 validation_error = 400 access_denied = 401 unavailable_payment_type = 402 duplicate_orde...
N = 4 board = [input() for _ in range(4)] for i in range(N): for j in range(N): cand = [] if j + 2 < N: cand.append([board[i][j+k] for k in range(3)]) if i + 2 < N: cand.append([board[i+k][j] for k in range(3)]) if i + 2 < N and j + 2 < N: cand.app...
n = 4 board = [input() for _ in range(4)] for i in range(N): for j in range(N): cand = [] if j + 2 < N: cand.append([board[i][j + k] for k in range(3)]) if i + 2 < N: cand.append([board[i + k][j] for k in range(3)]) if i + 2 < N and j + 2 < N: cand...
LOG_FILE = 'temperature.log' ZONE_ID = 'ZoneId' MAX_TEMP = 'MaximumTemperature' TRIGGERED = 'Triggered' INCORRECT_CREDENTIALS = 'Incorrect Credentials.' INCORRECT_ARGUEMENTS = 'Incorrect arguments provided - IP username password' TEMPERATURE_API = 'http://{}/axis-cgi/temperature_alarm/getzonestatus.cgi?' DATE_TIME...
log_file = 'temperature.log' zone_id = 'ZoneId' max_temp = 'MaximumTemperature' triggered = 'Triggered' incorrect_credentials = 'Incorrect Credentials.' incorrect_arguements = 'Incorrect arguments provided - IP username password' temperature_api = 'http://{}/axis-cgi/temperature_alarm/getzonestatus.cgi?' date_time_form...
def coroutine(seq): count = 0 while count < 200: count += yield seq.append(count) seq = [] c = coroutine(seq) next(c) ___assertEqual(seq, []) c.send(10) ___assertEqual(seq, [10]) c.send(10) ___assertEqual(seq, [10, 20])
def coroutine(seq): count = 0 while count < 200: count += (yield) seq.append(count) seq = [] c = coroutine(seq) next(c) ___assert_equal(seq, []) c.send(10) ___assert_equal(seq, [10]) c.send(10) ___assert_equal(seq, [10, 20])
# Make sure you follow the order of reaction # output should be H2O,CO2,CH4 def burner(c,h,o): water = co2 = methane = 0 if h >= 2 and o >= 1: if 2 * o >= h: water = h // 2 o -= water h -= 2*water else: water = o o -= water ...
def burner(c, h, o): water = co2 = methane = 0 if h >= 2 and o >= 1: if 2 * o >= h: water = h // 2 o -= water h -= 2 * water else: water = o o -= water h -= 2 * water if o >= 2 and c >= 1: if 2 * c >= o: ...
class Solution: def convertToBase7(self, num: int) -> str: if num == 0: return "0" num, neg = (num, False) if num > 0 else (-num, True) res = [] while num: num, r = divmod(num, 7) res.append(r) if neg: res.append("-") re...
class Solution: def convert_to_base7(self, num: int) -> str: if num == 0: return '0' (num, neg) = (num, False) if num > 0 else (-num, True) res = [] while num: (num, r) = divmod(num, 7) res.append(r) if neg: res.append('-') ...
fin = open("Crime.csv") for line in fin: word = line.split() def crime(): print(" Crime Type | Crime ID | Crime Count") if (word == "ASSAULT" and word =="ROBBERY" and word == "THEFT OF VEHICLE" and word == "BREAK AND ENTER"): print (word) lst = [] for i in word: lst.append(i) crime
fin = open('Crime.csv') for line in fin: word = line.split() def crime(): print(' Crime Type | Crime ID | Crime Count') if word == 'ASSAULT' and word == 'ROBBERY' and (word == 'THEFT OF VEHICLE') and (word == 'BREAK AND ENTER'): print(word) lst = [] for i in word: lst.append(i) crime
def reduce_polymer(orig, to_remove=None, max_len=-1): polymer = [] for i in range(len(orig)): # We save a lot of processing time for Part 2 # if we cut off the string building once the # array is too long if max_len > 0 and len(polymer) >= max_len: return None # The te...
def reduce_polymer(orig, to_remove=None, max_len=-1): polymer = [] for i in range(len(orig)): if max_len > 0 and len(polymer) >= max_len: return None if to_remove and orig[i].lower() == to_remove: continue polymer.append(orig[i]) end_pair = polymer[len(pol...
na, nb = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) a = set(a) b = set(b) t = len(a & b) t2 = len(a.union(b)) print(t/t2)
(na, nb) = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) a = set(a) b = set(b) t = len(a & b) t2 = len(a.union(b)) print(t / t2)
# # PySNMP MIB module MPLS-LC-FR-STD-MIB (http://pysnmp.sf.net) # ASN.1 source http://mibs.snmplabs.com:80/asn1/MPLS-LC-FR-STD-MIB # Produced by pysmi-0.0.7 at Sun Feb 14 00:21:02 2016 # On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose # Using Python version 3.5.0 (default, Jan 5 2016, 17:11...
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, constraints_intersection, value_size_constraint, single_value_constraint) ...
# O(n^2) overall def get_longest_increasing_subsequence(nums): l = len(nums) # reverse adjacency list O(n^2) reverse_adjacency = {i:set() for i in range(l)} for i,n in enumerate(nums): for j,e in enumerate(nums[i+1:], i +1): if n < e: reverse_adjacency[j].add(i) # dynam...
def get_longest_increasing_subsequence(nums): l = len(nums) reverse_adjacency = {i: set() for i in range(l)} for (i, n) in enumerate(nums): for (j, e) in enumerate(nums[i + 1:], i + 1): if n < e: reverse_adjacency[j].add(i) p = ['-'] * l max_len = [0] * l best...
# This is how we print something print("Hello!") # Let's use python3 hello.py to run the program # We can set variables my_variable = 5 print(my_variable) # We can make a list my_list = [1, 2, 3] print(my_list)
print('Hello!') my_variable = 5 print(my_variable) my_list = [1, 2, 3] print(my_list)
class Solution: def sortedSquares(self, A: List[int]) -> List[int]: A = [i*i for i in A] return sorted(A)
class Solution: def sorted_squares(self, A: List[int]) -> List[int]: a = [i * i for i in A] return sorted(A)
class Variable(object): def __init__(self, _id , offset): self._id = _id self.offset = offset def __str__(self): s = str(self._id) if self.offset: s = s + "/%d" % self.offset return s class VariableLimited(object): def __init__(self, _id , offset, size):...
class Variable(object): def __init__(self, _id, offset): self._id = _id self.offset = offset def __str__(self): s = str(self._id) if self.offset: s = s + '/%d' % self.offset return s class Variablelimited(object): def __init__(self, _id, offset, size):...
# -*- coding: utf-8 -*- # texttaglib's package version information __author__ = "Le Tuan Anh" __email__ = "tuananh.ke@gmail.com" __copyright__ = "Copyright (c) 2018, texttaglib, Le Tuan Anh" __credits__ = [] __license__ = "MIT License" __description__ = "Python library for managing and annotating text corpuses in diff...
__author__ = 'Le Tuan Anh' __email__ = 'tuananh.ke@gmail.com' __copyright__ = 'Copyright (c) 2018, texttaglib, Le Tuan Anh' __credits__ = [] __license__ = 'MIT License' __description__ = 'Python library for managing and annotating text corpuses in different formats (ELAN, TIG, TTL, et cetera)' __url__ = 'https://github...
# General things: RIGHT = 1 LEFT = 2 TOP = 3 BOTTOM = 4 # Names of layers class Layers: game_actors = 4 main = 3 sticky_background = 2 background = 1 background_color = 0 # Message names: (MSGNs) class MSGN: COLLISION_SIDES = 0 VELOCITY = 1 STATE = 100 LOOKDIRECTION = 101 STATESTACK = 102 # Warios states...
right = 1 left = 2 top = 3 bottom = 4 class Layers: game_actors = 4 main = 3 sticky_background = 2 background = 1 background_color = 0 class Msgn: collision_sides = 0 velocity = 1 state = 100 lookdirection = 101 statestack = 102 class Wariostates: upright_stay = 0 upri...
# -*- coding: utf-8 -*- account = { 'email': 'YOUR EMAIL', 'password': 'YOUR PASSWORD' } op = "Login" form_id = "packt_user_login_form" frequency = 8
account = {'email': 'YOUR EMAIL', 'password': 'YOUR PASSWORD'} op = 'Login' form_id = 'packt_user_login_form' frequency = 8
tabby_dog="\tI'm tabbed in"; persian_dog="I'm split\non s line." backslash_dog="i'm \\ a \\ dog" fat_dog="I'll do a list:\t* dog food \t* Fishies \t* Catnip\n\t* Grass" print(tabby_dog) print(persian_dog) print(backslash_dog) print(fat_dog)
tabby_dog = "\tI'm tabbed in" persian_dog = "I'm split\non s line." backslash_dog = "i'm \\ a \\ dog" fat_dog = "I'll do a list:\t* dog food \t* Fishies \t* Catnip\n\t* Grass" print(tabby_dog) print(persian_dog) print(backslash_dog) print(fat_dog)
# Change these to your instagram login credentials. username = "Username" password = "Password"
username = 'Username' password = 'Password'
#!chuck_extends project/urls.py #!chuck_appends URLS urlpatterns += patterns('', url(r'^', include('filer.server.urls')), url(r'^', include('cms.urls')), ) #!end
urlpatterns += patterns('', url('^', include('filer.server.urls')), url('^', include('cms.urls')))
# Easy horntail gem sm.spawnMob(8810202, 95, 260, False) sm.spawnMob(8810203, 95, 260, False) sm.spawnMob(8810204, 95, 260, False) sm.spawnMob(8810205, 95, 260, False) sm.spawnMob(8810206, 95, 260, False) sm.spawnMob(8810207, 95, 260, False) sm.spawnMob(8810208, 95, 260, False) sm.spawnMob(8810209, 95, 260, False) sm.s...
sm.spawnMob(8810202, 95, 260, False) sm.spawnMob(8810203, 95, 260, False) sm.spawnMob(8810204, 95, 260, False) sm.spawnMob(8810205, 95, 260, False) sm.spawnMob(8810206, 95, 260, False) sm.spawnMob(8810207, 95, 260, False) sm.spawnMob(8810208, 95, 260, False) sm.spawnMob(8810209, 95, 260, False) sm.spawnMob(8810214, 95,...
#https://codeforces.com/contest/1343/problem/C for _ in range(int(input())): n = int(input()) l = input().split() new = [] sn=[] nn=[] ans=0 for i in l: if i[0]!='-': sn.append(int(i)) if(nn!=[]): new.append(nn) nn=[] el...
for _ in range(int(input())): n = int(input()) l = input().split() new = [] sn = [] nn = [] ans = 0 for i in l: if i[0] != '-': sn.append(int(i)) if nn != []: new.append(nn) nn = [] else: nn.append(int(i)) ...
def in_bounds(matrix, i, j): rows = len(matrix) cols = len(matrix[0]) if i < 0 or i >= rows or j < 0 or j >= cols: return False return True def read_matrix(): matrix = [] while row := input(): matrix.append([int(num) for num in list(row)]) return matrix def pretty_print(ma...
def in_bounds(matrix, i, j): rows = len(matrix) cols = len(matrix[0]) if i < 0 or i >= rows or j < 0 or (j >= cols): return False return True def read_matrix(): matrix = [] while (row := input()): matrix.append([int(num) for num in list(row)]) return matrix def pretty_print...
#in=5 #in=10 #in=11 #in=20 #in=22 #in=30 #in=33 #in=40 #in=44 #in=50 #in=55 #golden=6050 n = input_int() out = 0 while (n > 0): x = input_int() y = input_int() out = out + x * y n = n - 1 print(out)
n = input_int() out = 0 while n > 0: x = input_int() y = input_int() out = out + x * y n = n - 1 print(out)
for _ in range(int(input())): n=int(input()) if n%2==0: check=0 while n%2==0: n=n//2 check+=1 if n<=1: if check%2: print("Bob") else: print("Alice") else: print("Alice") else: ...
for _ in range(int(input())): n = int(input()) if n % 2 == 0: check = 0 while n % 2 == 0: n = n // 2 check += 1 if n <= 1: if check % 2: print('Bob') else: print('Alice') else: print('Alic...
class Solution: def isOneEditDistance(self, s, t): l1, l2, cnt, i, j = len(s), len(t), 0, 0, 0 while i < l1 and j < l2: if s[i] != t[j]: cnt += 1 if l1 < l2: i -= 1 elif l1 > l2: j -= 1 i ...
class Solution: def is_one_edit_distance(self, s, t): (l1, l2, cnt, i, j) = (len(s), len(t), 0, 0, 0) while i < l1 and j < l2: if s[i] != t[j]: cnt += 1 if l1 < l2: i -= 1 elif l1 > l2: j -= 1 ...
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = "3.10" _lr_method = "LALR" _lr_signature = "A AFTER_TOMORROW AM AT BEFORE_YESTERDAY COLON DATE_END DAY MINUS MONTH NUMBER OF ON PAST_PHRASE PHRASE PLUS PM THE TIME TODAY TOMORROW WORD_NUMBER YEAR YESTERDAY\n da...
_tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'A AFTER_TOMORROW AM AT BEFORE_YESTERDAY COLON DATE_END DAY MINUS MONTH NUMBER OF ON PAST_PHRASE PHRASE PLUS PM THE TIME TODAY TOMORROW WORD_NUMBER YEAR YESTERDAY\n date_object :\n date_object : date_list\n date_list : date_list date\n date_list : dat...
def fakulteta(n): if n == 0: return 1 else: return n * fakulteta(n - 1) def vsota_stevk_fakultete(n): seznam = [int(d) for d in str(fakulteta(n))] vsota = 0 for i in range(0, len(seznam)): vsota = vsota + seznam[i] return(vsota) print(vsota_stevk_fakultete(100))
def fakulteta(n): if n == 0: return 1 else: return n * fakulteta(n - 1) def vsota_stevk_fakultete(n): seznam = [int(d) for d in str(fakulteta(n))] vsota = 0 for i in range(0, len(seznam)): vsota = vsota + seznam[i] return vsota print(vsota_stevk_fakultete(100))
class Motor: def __init__(self): self.velocidade = 0 def acelerar(self): self.velocidade += 1 def frear(self): self.velocidade -= 2 self.velocidade = max(0, self.velocidade) NORTE = 'Norte' SUL = 'Sul' LESTE = 'Leste' OESTE = 'Oeste' class Direcao: rotacao_a_direita_dc...
class Motor: def __init__(self): self.velocidade = 0 def acelerar(self): self.velocidade += 1 def frear(self): self.velocidade -= 2 self.velocidade = max(0, self.velocidade) norte = 'Norte' sul = 'Sul' leste = 'Leste' oeste = 'Oeste' class Direcao: rotacao_a_direita_d...
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) PORT = 11211 SERVICE_CHECK = 'memcache.can_connect'
port = 11211 service_check = 'memcache.can_connect'
PI = 3.1415 # Globale Variable def kreisumfang(radius): kreisumfang = 2 * PI * radius return kreisumfang def zylinder(radius, hoehe): return hoehe * kreisumfang(radius) print(zylinder(50, 20))
pi = 3.1415 def kreisumfang(radius): kreisumfang = 2 * PI * radius return kreisumfang def zylinder(radius, hoehe): return hoehe * kreisumfang(radius) print(zylinder(50, 20))
def help_normalize_variations(variations: list[dict]) -> list[dict]: list_normalized = [] obj_normalized = {} list_obj_normalized = [] last_color = "" count = 0 for element in variations: if last_color == element.color or last_color == "": list_normalized.append( ...
def help_normalize_variations(variations: list[dict]) -> list[dict]: list_normalized = [] obj_normalized = {} list_obj_normalized = [] last_color = '' count = 0 for element in variations: if last_color == element.color or last_color == '': list_normalized.append({'size': elem...
class aSumPrint: def run(self, context): #include context a_sum = context["aSum"] #to extract from shared dictionary print(f'a_sum = {a_sum}') def __call__(self, context): self.run(context) #to run the function
class Asumprint: def run(self, context): a_sum = context['aSum'] print(f'a_sum = {a_sum}') def __call__(self, context): self.run(context)
#set following variables types_of_people = 10 x = f"There are {types_of_people} types of people." binary = "binary" do_not = "don't" y = f"Those who know {binary} and those who {do_not}." #print variables "x" and "y" to create sentences print(x) print(y) #print f-strings, notated with "f" in initial position. #Using...
types_of_people = 10 x = f'There are {types_of_people} types of people.' binary = 'binary' do_not = "don't" y = f'Those who know {binary} and those who {do_not}.' print(x) print(y) print(f'I said: {x}') print(f"I also said: '{y}'") hilarious = False joke_evaluation = "Isn't that joke so funny?! {}" print(joke_evaluatio...
comida = ["tacos", "pozole", "pan de muerto", "pastel", "spaghetti", "gorditas"] print("Acceder a los elementos de la lista individualmente") print(comida[0]) print(comida[2]) print(comida[5]) print("Mostrar todos los elementos") print(comida) print() print("Eliminar algun elemento") del comida[3] comida.pop() print...
comida = ['tacos', 'pozole', 'pan de muerto', 'pastel', 'spaghetti', 'gorditas'] print('Acceder a los elementos de la lista individualmente') print(comida[0]) print(comida[2]) print(comida[5]) print('Mostrar todos los elementos') print(comida) print() print('Eliminar algun elemento') del comida[3] comida.pop() print(co...
class Solution: def depthSum(self, nestedList: List[NestedInteger]) -> int: def helper(current, depth): res = 0 for item in current: if item.isInteger(): res += item.getInteger() * depth else: res += helper(it...
class Solution: def depth_sum(self, nestedList: List[NestedInteger]) -> int: def helper(current, depth): res = 0 for item in current: if item.isInteger(): res += item.getInteger() * depth else: res += helper(it...
argv = [''] def exit(n): pass exit(0) stdout = open("/dev/null") stderr = open("/dev/null") stdin = open("/dev/null")
argv = [''] def exit(n): pass exit(0) stdout = open('/dev/null') stderr = open('/dev/null') stdin = open('/dev/null')
x = int(input()) n = int(input()) a = [] for y in range(n): a.append(input().split()) for y in range(n): if x >= int(a[y][0]) and x <= int(a[y][1]): print(a[y][2])
x = int(input()) n = int(input()) a = [] for y in range(n): a.append(input().split()) for y in range(n): if x >= int(a[y][0]) and x <= int(a[y][1]): print(a[y][2])
print("Sartu zenbakiak...") a=int(input("Sartu lehenengoa: ")) b=int(input("sartu bigarrena: ")) def baino_haundiagoa(a, b): if a > b: return("Lehenengo zenbakia haundiagoa da.") elif a < b: return("Bigarren zenbakia haundiagoa da.") else: return("Zenbaki berdina sartu dezu.") pr...
print('Sartu zenbakiak...') a = int(input('Sartu lehenengoa: ')) b = int(input('sartu bigarrena: ')) def baino_haundiagoa(a, b): if a > b: return 'Lehenengo zenbakia haundiagoa da.' elif a < b: return 'Bigarren zenbakia haundiagoa da.' else: return 'Zenbaki berdina sartu dezu.' prin...
''' @author: Kittl ''' def exportSubstations(dpf, exportProfile, tables, colHeads): # Get the index in the list of worksheets if exportProfile is 2: cmpStr = "Substation" elif exportProfile is 3: cmpStr = "" idxWs = [idx for idx,val in enumerate(tables[exportProfile-1]) if val == cm...
""" @author: Kittl """ def export_substations(dpf, exportProfile, tables, colHeads): if exportProfile is 2: cmp_str = 'Substation' elif exportProfile is 3: cmp_str = '' idx_ws = [idx for (idx, val) in enumerate(tables[exportProfile - 1]) if val == cmpStr] if not idxWs: dpf.Print...