content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def math(): lists = [] count = 0 for i in range(20): j = int(input()) lists.append(j) for j in range(20)[::-1]: print('N[' + str(count) + '] =', lists[j]) count += 1 if __name__ == '__main__': math()
def math(): lists = [] count = 0 for i in range(20): j = int(input()) lists.append(j) for j in range(20)[::-1]: print('N[' + str(count) + '] =', lists[j]) count += 1 if __name__ == '__main__': math()
class NumberCheckerOnGroup: @classmethod def numberToGroup(cls, tNumber): clsNumber = 1 if tNumber >= 1 and tNumber <= 9: clsNumber = 1 elif tNumber >= 10 and tNumber <= 19: clsNumber = 10 elif tNumber >= 20 and tNumber <= 29: clsNumber = 20...
class Numbercheckerongroup: @classmethod def number_to_group(cls, tNumber): cls_number = 1 if tNumber >= 1 and tNumber <= 9: cls_number = 1 elif tNumber >= 10 and tNumber <= 19: cls_number = 10 elif tNumber >= 20 and tNumber <= 29: cls_number ...
#addBorder picture = ["abc", "ded"] def addBorder(mang): print("*****") for x in mang: print("*"+x+"*") print("*****")
picture = ['abc', 'ded'] def add_border(mang): print('*****') for x in mang: print('*' + x + '*') print('*****')
class Student: free_students = set() def __init__(self, sid: int, pref_list: list, math_grade, cs_grade, utils): self.sid = sid self.math_grade = math_grade self.cs_grade = cs_grade self.pref_list = pref_list self.project = None self.utils = utils self.pa...
class Student: free_students = set() def __init__(self, sid: int, pref_list: list, math_grade, cs_grade, utils): self.sid = sid self.math_grade = math_grade self.cs_grade = cs_grade self.pref_list = pref_list self.project = None self.utils = utils self.pa...
text = "X-DSPAM-Confidence: 0.8475" pos = text.find(':') numString = text[pos+1:] num = float(numString) print(num)
text = 'X-DSPAM-Confidence: 0.8475' pos = text.find(':') num_string = text[pos + 1:] num = float(numString) print(num)
def IsPrime(num): for i in range(2, num): if num % i == 0: return False return True fac = [] def solve(num): i = 2 while i <= num: if not IsPrime(i): i += 1 continue if num % i == 0: fac.append(i) num /= i else...
def is_prime(num): for i in range(2, num): if num % i == 0: return False return True fac = [] def solve(num): i = 2 while i <= num: if not is_prime(i): i += 1 continue if num % i == 0: fac.append(i) num /= i els...
#!/usr/bin/env python # -*- coding: utf-8 -*- class TrackedObj(object): def __init__(self, val): self.val = val def __str__(self): return '[%s]' % self.val class TrackField(TrackedObj): pass class TrackIndex(TrackedObj): pass class TrackVariant(TrackedObj): pass class Trac...
class Trackedobj(object): def __init__(self, val): self.val = val def __str__(self): return '[%s]' % self.val class Trackfield(TrackedObj): pass class Trackindex(TrackedObj): pass class Trackvariant(TrackedObj): pass class Tracker(object): def __init__(self): self....
def standardize_text(df, question_field): df[question_field] = df[question_field].str.replace(r"http\S+", "") df[question_field] = df[question_field].str.replace(r"http", "") df[question_field] = df[question_field].str.replace(r"@\S+", "") df[question_field] = df[question_field].str.replace( r"[...
def standardize_text(df, question_field): df[question_field] = df[question_field].str.replace('http\\S+', '') df[question_field] = df[question_field].str.replace('http', '') df[question_field] = df[question_field].str.replace('@\\S+', '') df[question_field] = df[question_field].str.replace('[^A-Za-z0-9(...
class Solution: def countPairs(self, nums: List[int], k: int) -> int: ans = 0 gcds = Counter() for num in nums: gcd_i = math.gcd(num, k) for gcd_j, count in gcds.items(): if gcd_i * gcd_j % k == 0: ans += count gcds[gcd_i] += 1 return ans
class Solution: def count_pairs(self, nums: List[int], k: int) -> int: ans = 0 gcds = counter() for num in nums: gcd_i = math.gcd(num, k) for (gcd_j, count) in gcds.items(): if gcd_i * gcd_j % k == 0: ans += count gcds[...
class WebDriverFactory: def __init__(self): self._drivers = {} self._driver_options = {} def register_web_driver(self, driver_type, web_driver, driver_options): self._drivers[driver_type] = web_driver self._driver_options[driver_type] = driver_options def get_registered_web...
class Webdriverfactory: def __init__(self): self._drivers = {} self._driver_options = {} def register_web_driver(self, driver_type, web_driver, driver_options): self._drivers[driver_type] = web_driver self._driver_options[driver_type] = driver_options def get_registered_we...
class Image: def __init__(self): pass # @classmethod # def load(cls, path): # # raise NotImplementedError
class Image: def __init__(self): pass
''' Just like a balloon without a ribbon, an object without a reference variable cannot be used later. ''' class Mobile: def __init__(self, price, brand): self.price = price self.brand = brand Mobile(1000, "Apple") #After the above line the Mobile # object created is lost and unusable
""" Just like a balloon without a ribbon, an object without a reference variable cannot be used later. """ class Mobile: def __init__(self, price, brand): self.price = price self.brand = brand mobile(1000, 'Apple')
expected_output = { "slot": { "rp0": { "cpu": { "0": { "idle": 99.1, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.2, "user": 0.7, "waiting...
expected_output = {'slot': {'rp0': {'cpu': {'0': {'idle': 99.1, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.2, 'user': 0.7, 'waiting': 0.0}, '1': {'idle': 98.69, 'irq': 0.0, 'nice_process': 0.0, 'sirq': 0.0, 'system': 0.3, 'user': 1.0, 'waiting': 0.0}, '10': {'idle': 97.3, 'irq': 0.0, 'nice_process': 0.0,...
# Create a program that receives two strings on a single line separated by a single space. # Then, it prints the sum of their multiplied character codes as follows: # multiply str1[0] with str2[0] and add the result to the total sum, then continue with the next two characters. # If one of the strings is longer than ...
sum_of_multiplication = lambda x, y: sum([ord(x[i]) * ord(y[i]) for i in range(min(len(x), len(y)))]) def addition_of_remainder(x, y): diff = abs(len(x) - len(y)) if len(x) > len(y): return sum([ord(ch) for ch in x[-diff:]]) elif len(y) > len(x): return sum([ord(ch) for ch in y[-diff:]]) ...
OPENERS = {'(', '{', '['} CLOSER_MAP = {')': '(', '}': '{', ']': '['} def solve(s: str) -> bool: stack = [] for c in s: if c in OPENERS: stack.append(c) elif len(stack) == 0 or stack.pop() != CLOSER_MAP[c]: return False return True if len(stack) == 0 else False def ...
openers = {'(', '{', '['} closer_map = {')': '(', '}': '{', ']': '['} def solve(s: str) -> bool: stack = [] for c in s: if c in OPENERS: stack.append(c) elif len(stack) == 0 or stack.pop() != CLOSER_MAP[c]: return False return True if len(stack) == 0 else False def ...
''' Task: Your task is to write a function which returns the sum of following series upto nth term(parameter). Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +... Rules: You need to round the answer to 2 decimal places and return it as String. If the given value is 0 then it should return 0.00 You will only be given Nat...
""" Task: Your task is to write a function which returns the sum of following series upto nth term(parameter). Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +... Rules: You need to round the answer to 2 decimal places and return it as String. If the given value is 0 then it should return 0.00 You will only be given Nat...
def count_unique_values(arr): # return 0 of the length of array is 0 # loop the array by the second element at index j # compare the previous element at index i arr_len = len(arr) if arr_len == 0: return 0 pre_index = 0 unique_arr = [arr[pre_index]] for j in range(1, arr_len): ...
def count_unique_values(arr): arr_len = len(arr) if arr_len == 0: return 0 pre_index = 0 unique_arr = [arr[pre_index]] for j in range(1, arr_len): if arr[pre_index] != arr[j]: unique_arr.append(arr[j]) pre_index = j print(unique_arr) return len(unique_...
#05_01_converter class ScaleConverter: def __init__(self, units_from, units_to, factor): self.units_from = units_from self.units_to = units_to self.factor = factor def description(self): return 'Convert ' + self.units_from + ' to ' + self.units_to def convert(self, value): return value * self.factor ...
class Scaleconverter: def __init__(self, units_from, units_to, factor): self.units_from = units_from self.units_to = units_to self.factor = factor def description(self): return 'Convert ' + self.units_from + ' to ' + self.units_to def convert(self, value): return v...
#local storage LOCAL="/home/pi/MTU-Timelapse-Pi" #in minutes. 60 % interval must be 0 INTERVAL=5 #time between failed uploads FAILTIME=5 #retry count RETRYCOUNT=3 CMD="raspistill -o '/home/pi/MTU-Timelapse-Pi/cam/%s/%s-%s.jpg' -h 1080 -w 1920 --nopreview --timeout 1"
local = '/home/pi/MTU-Timelapse-Pi' interval = 5 failtime = 5 retrycount = 3 cmd = "raspistill -o '/home/pi/MTU-Timelapse-Pi/cam/%s/%s-%s.jpg' -h 1080 -w 1920 --nopreview --timeout 1"
class line(object): def __init__(self, _char, _row, _column, _dir, _length): self.char = _char self.row = _row self.column = _column self.dir = _dir self.length = _length return None
class Line(object): def __init__(self, _char, _row, _column, _dir, _length): self.char = _char self.row = _row self.column = _column self.dir = _dir self.length = _length return None
A, B, C = map(int, input().split()) print((A+B)%C) print((A%C+B%C)%C) print((A*B)%C) print(((A%C)*(B%C))%C)
(a, b, c) = map(int, input().split()) print((A + B) % C) print((A % C + B % C) % C) print(A * B % C) print(A % C * (B % C) % C)
lst_1=[1,2,4,88] lst_2=[1,3,4,95,120] lst_3=[] i=0 j=0 for k in range(len(lst_1)+len(lst_2)): if (lst_1[i]<= (lst_2[j])): lst_3.append(lst_1[i]) if (i>=len(lst_1)-1): if j<=(len(lst_2)-1): lst_3.append(lst_2[j]) if j<len(lst_2)-1: ...
lst_1 = [1, 2, 4, 88] lst_2 = [1, 3, 4, 95, 120] lst_3 = [] i = 0 j = 0 for k in range(len(lst_1) + len(lst_2)): if lst_1[i] <= lst_2[j]: lst_3.append(lst_1[i]) if i >= len(lst_1) - 1: if j <= len(lst_2) - 1: lst_3.append(lst_2[j]) if j < len(lst_2) - 1: ...
__author__ = 'shukkkur' ''' https://codeforces.com/problemset/problem/1475/B B. New Year's Number ''' t = int(input()) for _ in range(t): n = int(input()) if n < 2020: print('NO') else: if n % 2020 <= n / 2020: print('YES') ...
__author__ = 'shukkkur' "\nhttps://codeforces.com/problemset/problem/1475/B\nB. New Year's Number\n" t = int(input()) for _ in range(t): n = int(input()) if n < 2020: print('NO') elif n % 2020 <= n / 2020: print('YES') else: print('NO')
def caller(): a = [] for i in range(33, 49): a.append(chr(i)) b = [] c = [] d = [] for i in range(65, 91): b.append(chr(i)) for i in range(97, 123): c.append(chr(i)) for i in range(48, 58): d.append(chr(i)) ...
def caller(): a = [] for i in range(33, 49): a.append(chr(i)) b = [] c = [] d = [] for i in range(65, 91): b.append(chr(i)) for i in range(97, 123): c.append(chr(i)) for i in range(48, 58): d.append(chr(i)) return (a, b, c, d)
class Beacon(): def __init__(self, sprite, type): self.sprite = sprite self.type = type ''' self.x = 0 self.y = 0 def set_pos(self, x, y): self.x = x self.y = y ''' @property def position(self): return self.sprite.posit...
class Beacon: def __init__(self, sprite, type): self.sprite = sprite self.type = type '\n self.x = 0\n self.y = 0\n def set_pos(self, x, y):\n self.x = x\n self.y = y \n ' @property def position(self): return self.sprite.position @p...
class Attribute: NAME = 'Keyboard' class KeyState: LEFT_ARROW_DOWN = 'leftArrowDown' RIGHT_ARROW_DOWN = 'rightArrowDown' UP_ARROW_DOWN = 'upArrowDown' DOWN_ARROW_DOWN = 'downArrowDown'
class Attribute: name = 'Keyboard' class Keystate: left_arrow_down = 'leftArrowDown' right_arrow_down = 'rightArrowDown' up_arrow_down = 'upArrowDown' down_arrow_down = 'downArrowDown'
#Hierarchical Inheritance class A: #Super Class or Parent Class def feature1(self): print("Feature 1 Working") def feature2(self): print("Feature 2 Working") class B(A): # Subclass or Child Class def feature3(self): print("Feature 3 Working") def feature4(self): pr...
class A: def feature1(self): print('Feature 1 Working') def feature2(self): print('Feature 2 Working') class B(A): def feature3(self): print('Feature 3 Working') def feature4(self): print('Feature 4 Working') class C(A): def feature5(self): print('Featu...
def hurdleRace(k, height): if k >= max(height): return 0 else: return max(height) - k # test case h = [1,3,4,5,2,5] print(hurdleRace(3, h)) # Should be 2 print(hurdleRace(8, h)) # Should be 0
def hurdle_race(k, height): if k >= max(height): return 0 else: return max(height) - k h = [1, 3, 4, 5, 2, 5] print(hurdle_race(3, h)) print(hurdle_race(8, h))
# try: # except KeyError: # return render(request, "circle/error.html", context={"message": "Upload file.!!", "type": "Key Error", "link": "newArticle"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field image.!!", "type": "Value Error", "link...
message_tags = {messages.DEBUG: 'alert-secondary', messages.INFO: 'alert-info', messages.SUCCESS: 'alert-success', messages.WARNING: 'alert-warning', messages.ERROR: 'alert-danger'} def verification(request): ph_no = 9316300064 request.session['ph_no'] = ph_no otp = str(random.randint(100000, 999999)) ...
class Solution: def isPalindrome(self, s: str) -> bool: string2 = "" for character in s.lower(): if character.isalnum(): string2 += character if string2 == string2[::-1]: return True return False
class Solution: def is_palindrome(self, s: str) -> bool: string2 = '' for character in s.lower(): if character.isalnum(): string2 += character if string2 == string2[::-1]: return True return False
squares = [value ** 2 for value in range(1, 11)] print(squares) cubes = [value ** 3 for value in range(1, 11)] print(cubes) a_million = list(range(1, 1_000_0001)) print(min(a_million)) print(max(a_million)) print(sum(a_million))
squares = [value ** 2 for value in range(1, 11)] print(squares) cubes = [value ** 3 for value in range(1, 11)] print(cubes) a_million = list(range(1, 10000001)) print(min(a_million)) print(max(a_million)) print(sum(a_million))
class Restaurant: def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type self.number_serverd = 0 def describe_restaurant(self): print(f'Welcome to {self.restaurant_name.title()}') print(f'Our cousine ...
class Restaurant: def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type self.number_serverd = 0 def describe_restaurant(self): print(f'Welcome to {self.restaurant_name.title()}') print(f'Our cousine ty...
mtx = [] while True: n = str(input()) if n == 'end': break mtx.append([int(s) for s in n.split()]) out_mtx = [[0 for j in range(len(mtx[i]))] for i in range(len(mtx))] for i in range(len(mtx)): for j in range(len(mtx[i])): ylen = len(mtx) xlen = len(mtx[0]) out_mtx[i][...
mtx = [] while True: n = str(input()) if n == 'end': break mtx.append([int(s) for s in n.split()]) out_mtx = [[0 for j in range(len(mtx[i]))] for i in range(len(mtx))] for i in range(len(mtx)): for j in range(len(mtx[i])): ylen = len(mtx) xlen = len(mtx[0]) out_mtx[i][j] ...
# https://leetcode.com/problems/check-array-formation-through-concatenation/ class Solution: def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool: result = [] for j in arr: for i in pieces: if i[0] == j: for m in range(len...
class Solution: def can_form_array(self, arr: List[int], pieces: List[List[int]]) -> bool: result = [] for j in arr: for i in pieces: if i[0] == j: for m in range(len(i)): result.append(i[m]) if result == arr: ...
a = 10 b = 3 print('Add -', a + b) print('Subtract -', a - b) print('Multiply -', a * b) print('Divide (with floating point) -', a / b) print('Divide (ignoring floats) -', a // b) # With interactive python # >>> 10 / 3 # 3.3333333333333335 # >>> 10.0 / 3 # 3.3333333333333335 # >>> 10 // 3 # 3 # >>> 10 // 3.0 # 3.0 p...
a = 10 b = 3 print('Add -', a + b) print('Subtract -', a - b) print('Multiply -', a * b) print('Divide (with floating point) -', a / b) print('Divide (ignoring floats) -', a // b) print('Remainder or Modulus -', a % b) print('a raised to power b -', a ** b) a += b print('a incremented by b -', a) a -= b print('a decrem...
class IrregualrConfigParser(object): COMMENT_FLAGS = ("#", ";") def __init__(self): super(IrregualrConfigParser, self).__init__() self.__content = [] def read(self, fn_or_fp): content = [] if isinstance(fn_or_fp, file): content = [line.strip() for line in fn_or_...
class Irregualrconfigparser(object): comment_flags = ('#', ';') def __init__(self): super(IrregualrConfigParser, self).__init__() self.__content = [] def read(self, fn_or_fp): content = [] if isinstance(fn_or_fp, file): content = [line.strip() for line in fn_or_...
def readConstants(constants_list): constants = [] for attribute, value in constants_list.items(): constants.append({"name": attribute, "cname": "c_" + attribute, "value": value}) return constants def readClocks(clocks_lists): clocks = {"par": [], "seq": []} for attribute, value in clocks_...
def read_constants(constants_list): constants = [] for (attribute, value) in constants_list.items(): constants.append({'name': attribute, 'cname': 'c_' + attribute, 'value': value}) return constants def read_clocks(clocks_lists): clocks = {'par': [], 'seq': []} for (attribute, value) in clo...
def main() -> None: N = int(input()) S = [] T = [] for _ in range(N): S.append(input()) for _ in range(N): T.append(input()) assert 1 <= N <= 100 assert all(len(S_i) == N for S_i in S) assert all(len(T_i) == N for T_i in S) assert all(S_ij in ('.', '#') for S_i in S...
def main() -> None: n = int(input()) s = [] t = [] for _ in range(N): S.append(input()) for _ in range(N): T.append(input()) assert 1 <= N <= 100 assert all((len(S_i) == N for s_i in S)) assert all((len(T_i) == N for t_i in S)) assert all((S_ij in ('.', '#') for s_i i...
def fib(n): if n == 1: return 1 return n + fib(n-1) def main(): n = 0 m = 1 result = 0 while n < 4000000: tmp = n n = n + m m = tmp if n % 2 == 0: result += n # print(n, n % 2) # print(n, result) print("Problem 2:", result)
def fib(n): if n == 1: return 1 return n + fib(n - 1) def main(): n = 0 m = 1 result = 0 while n < 4000000: tmp = n n = n + m m = tmp if n % 2 == 0: result += n print('Problem 2:', result)
# file path (load_data.py, main.py, and compute_relation_vectors.py) _SOURCE_DATA = '../data/source.csv' _TARGET_DATA = '../data/target.csv' _RESULT_FILE = '../results/results.csv' _MEAN_RELATION = '../results/relation_vectors_before.csv' _MODIFIED_MEAN_RELATINON = '../results/relation_vectors_after.csv' _COUNT_...
_source_data = '../data/source.csv' _target_data = '../data/target.csv' _result_file = '../results/results.csv' _mean_relation = '../results/relation_vectors_before.csv' _modified_mean_relatinon = '../results/relation_vectors_after.csv' _count_relatinon = '../results/count_ver_relation_vectors.csv' _source_dim_num = 9 ...
class Instruction: def __init__(self, name): if not(name in dir(self)): raise Exception("Instruction not exists") self.name = name def execute(self, cpu, a, b, c): func = getattr(self,self.name) func(cpu, a, b, c) def addr(self, cpu, a, b, c): ...
class Instruction: def __init__(self, name): if not name in dir(self): raise exception('Instruction not exists') self.name = name def execute(self, cpu, a, b, c): func = getattr(self, self.name) func(cpu, a, b, c) def addr(self, cpu, a, b, c): if not se...
''' modifier: 02 eqtime: 10 ''' def main(): info("Jan Air Sniff Pipette x1") gosub('jan:WaitForMiniboneAccess') gosub('jan:PrepareForAirShot') gosub('jan:EvacPipette2') gosub('common:FillPipette2') gosub('jan:PrepareForAirShotExpansion') close(name="M", description="Microbone to Getter NP-10...
""" modifier: 02 eqtime: 10 """ def main(): info('Jan Air Sniff Pipette x1') gosub('jan:WaitForMiniboneAccess') gosub('jan:PrepareForAirShot') gosub('jan:EvacPipette2') gosub('common:FillPipette2') gosub('jan:PrepareForAirShotExpansion') close(name='M', description='Microbone to Getter NP-1...
class Verdict: OK = 'OK' WA = 'WA' RE = 'RE' CE = 'CE' TL = 'TL' ML = 'ML' FAIL = 'FAIL' NR = 'NR'
class Verdict: ok = 'OK' wa = 'WA' re = 'RE' ce = 'CE' tl = 'TL' ml = 'ML' fail = 'FAIL' nr = 'NR'
# 2014.10.20 12:29:04 CEST typew = {'AROMATIC': 3.0, 'DOUBLE': 2.0, 'TRIPLE': 3.0, 'SINGLE': 1.0} heterow = {False: 2, True: 1} missingfragmentpenalty = 10.0 mims = {'H': 1.0078250321, 'He': 3.016029, 'Li': 6.015122, 'Be': 9.012182, 'B': 10.012937, 'C': 12.000000, 'N': 14.0030740052, 'O': 15.9949146221, 'F...
typew = {'AROMATIC': 3.0, 'DOUBLE': 2.0, 'TRIPLE': 3.0, 'SINGLE': 1.0} heterow = {False: 2, True: 1} missingfragmentpenalty = 10.0 mims = {'H': 1.0078250321, 'He': 3.016029, 'Li': 6.015122, 'Be': 9.012182, 'B': 10.012937, 'C': 12.0, 'N': 14.0030740052, 'O': 15.9949146221, 'F': 18.9984032, 'Ne': 19.99244, 'Na': 22.98976...
for i in range(1, 101): name = str(i) name = name + ".txt" print(name) print(type(name)) arq = open(name, "w") arq.close();
for i in range(1, 101): name = str(i) name = name + '.txt' print(name) print(type(name)) arq = open(name, 'w') arq.close()
def post_to_dict(post): data = {} data["owner_username"] = post.owner_username data["owner_id"] = post.owner_id data["post_date"] = post.date_utc data["post_caption"] = post.caption data["tagged_users"] = post.tagged_users data["caption_mentions"] = post.caption_mentions data["is...
def post_to_dict(post): data = {} data['owner_username'] = post.owner_username data['owner_id'] = post.owner_id data['post_date'] = post.date_utc data['post_caption'] = post.caption data['tagged_users'] = post.tagged_users data['caption_mentions'] = post.caption_mentions data['is_video']...
class Solution: def equationsPossible(self, equations: List[str]) -> bool: parent = {} def findParent(x): if x not in parent: parent[x] = x else: while parent[x] != x: parent[x] = parent[parent[x]] x = pa...
class Solution: def equations_possible(self, equations: List[str]) -> bool: parent = {} def find_parent(x): if x not in parent: parent[x] = x else: while parent[x] != x: parent[x] = parent[parent[x]] x ...
def new_decorator(func): def wrapper_func(): print('code before executing func') func() print('func() has been called') return wrapper_func @new_decorator def func_needs_decorator(): print('this function is in need of decorator!') # func_needs_decorator() # before adding @new_d...
def new_decorator(func): def wrapper_func(): print('code before executing func') func() print('func() has been called') return wrapper_func @new_decorator def func_needs_decorator(): print('this function is in need of decorator!') func_needs_decorator()
class Stats: def min(dataset): value = dataset[0] for data in dataset: if data < value: value = data return value def max(dataset): value = dataset[0] for data in dataset: if data > value: value = data return value def range(dataset): return Stats.max(dataset) - Stats.min(dataset) def me...
class Stats: def min(dataset): value = dataset[0] for data in dataset: if data < value: value = data return value def max(dataset): value = dataset[0] for data in dataset: if data > value: value = data retu...
######## # PART 1 # on python 3.7+ can just call pow(base, exp, mod), no need to implement anything! def modexp(base, exp, mod): ''' mod exp by repeated squaring ''' res = 1 cur = base while (exp > 0): if (exp % 2 == 1): res = (res * cur) % mod exp = exp >> 1 cur = ...
def modexp(base, exp, mod): """ mod exp by repeated squaring """ res = 1 cur = base while exp > 0: if exp % 2 == 1: res = res * cur % mod exp = exp >> 1 cur = cur * cur % mod return res (row, col) = (2981, 3075) firstcode = 20151125 base = 252533 mod = 33554393 di...
# swap it to get solution fin = open("pic.png", "rb") fout = open("../public/file.bin", "wb") data = fin.read()[::-1] result = bytearray() for byte in data: high = byte >> 4 low = byte & 0xF rbyte = (low << 4) + high result.append(rbyte) fout.write(result) fout.close()
fin = open('pic.png', 'rb') fout = open('../public/file.bin', 'wb') data = fin.read()[::-1] result = bytearray() for byte in data: high = byte >> 4 low = byte & 15 rbyte = (low << 4) + high result.append(rbyte) fout.write(result) fout.close()
WTF_CSRF_ENABLED = True SECRET_KEY = 'you-will-never-guess' projects = {}
wtf_csrf_enabled = True secret_key = 'you-will-never-guess' projects = {}
# some specific relevant fields timestamp_field = 'requestInTs' service_call_fields = ["clientMemberClass", "clientMemberCode", "clientXRoadInstance", "clientSubsystemCode", "serviceCode", "serviceVersion", "serviceMemberClass", "serviceMemberCode", "serviceXRoadInstance", ...
timestamp_field = 'requestInTs' service_call_fields = ['clientMemberClass', 'clientMemberCode', 'clientXRoadInstance', 'clientSubsystemCode', 'serviceCode', 'serviceVersion', 'serviceMemberClass', 'serviceMemberCode', 'serviceXRoadInstance', 'serviceSubsystemCode'] relevant_cols_general = ['_id', 'totalDuration', 'prod...
n, k = map(int, input().split()) graph = [] printInfo = [] for i in range(n): graph.append([]) for i in range(k): oper, u, v = input().split() u = int(u) - 1 v = int(v) - 1 if oper == '+': graph[u] += [v] graph[v] += [u] if oper == '?': if not(graph[u] and graph[v]): printInfo += ['?'] elif set...
(n, k) = map(int, input().split()) graph = [] print_info = [] for i in range(n): graph.append([]) for i in range(k): (oper, u, v) = input().split() u = int(u) - 1 v = int(v) - 1 if oper == '+': graph[u] += [v] graph[v] += [u] if oper == '?': if not (graph[u] and graph[v])...
# A colection of key value pairs # Keys need to be a string my_dict = {'name':'john', 'age':27, 'gender':'male', 'subs': ['Eng', 'Math', 'Sci'], 'marks':(58, 79,63)} print(my_dict['name']) print(my_dict['age']) my_dict['age'] += 3 print(my_dict['age']) print(my_dict['subs']) print(my_dict['marks']) print(my_dict['s...
my_dict = {'name': 'john', 'age': 27, 'gender': 'male', 'subs': ['Eng', 'Math', 'Sci'], 'marks': (58, 79, 63)} print(my_dict['name']) print(my_dict['age']) my_dict['age'] += 3 print(my_dict['age']) print(my_dict['subs']) print(my_dict['marks']) print(my_dict['subs'][1], end='--') print(my_dict['marks'][1]) d = {} d['ke...
simulation_parameters = { 'temperature', 'integrator', 'collisions_rate', 'integration_timestep', 'initial_velocities_to_temperature', 'constraint_tolerance', 'platform', 'cuda_precision' } def is_simulation_dict(dictionary): keys=set(dictionary.keys()) output = (keys <= simulation_parameters) ...
simulation_parameters = {'temperature', 'integrator', 'collisions_rate', 'integration_timestep', 'initial_velocities_to_temperature', 'constraint_tolerance', 'platform', 'cuda_precision'} def is_simulation_dict(dictionary): keys = set(dictionary.keys()) output = keys <= simulation_parameters return output
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"triee": "00_core.ipynb", "cov": "01_oval_clean.ipynb", "numpts": "01_oval_clean.ipynb", "Points": "01_oval_clean.ipynb", "vlen": "01_oval_clean.ipynb", "major": "...
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'triee': '00_core.ipynb', 'cov': '01_oval_clean.ipynb', 'numpts': '01_oval_clean.ipynb', 'Points': '01_oval_clean.ipynb', 'vlen': '01_oval_clean.ipynb', 'major': '01_oval_clean.ipynb', 'minor': '01_oval_clean.ipynb', 'x_vec': '01_oval_clean.ipynb', ...
def findMinHeightTrees(n, edges): ''' :param n: int :param edges: List[List[int]] :return: List[int] ''' # create n empty set object tree = [set() for _ in range(n)] # u as vertex, v denotes neighbor vertices # set add method ensure no repeat neighbor vertices for u, v in edges...
def find_min_height_trees(n, edges): """ :param n: int :param edges: List[List[int]] :return: List[int] """ tree = [set() for _ in range(n)] for (u, v) in edges: (tree[u].add(v), tree[v].add(u)) (q, nq) = ([x for x in range(n) if len(tree[x]) < 2], []) while True: for...
def solution(number): sum = 0 for x in range(1,number): if x % 3 == 0: sum +=x elif x % 5 == 0: sum +=x elif x % 3 and x % 5 == 0: continue return sum
def solution(number): sum = 0 for x in range(1, number): if x % 3 == 0: sum += x elif x % 5 == 0: sum += x elif x % 3 and x % 5 == 0: continue return sum
class AbstractCrawler: def __init__(self, num, init): self.num = num self.init = init def crawl(self, es, client, process): raise NotImplementedError("This should be implemented.")
class Abstractcrawler: def __init__(self, num, init): self.num = num self.init = init def crawl(self, es, client, process): raise not_implemented_error('This should be implemented.')
height = int(input()) for i in range(1, height + 1): value = 3 * height - i - 1 for j in range(1,i+1): if(i == height): print(height + j - 1,end=" ") elif(j == 1): print(i,end=" ") elif(j == i): print(value,end=" ") else: ...
height = int(input()) for i in range(1, height + 1): value = 3 * height - i - 1 for j in range(1, i + 1): if i == height: print(height + j - 1, end=' ') elif j == 1: print(i, end=' ') elif j == i: print(value, end=' ') else: print(e...
x = 5 print(type(x)); x = "6" print(type(x)) x = 5.0 print(type(x)) x = 3.45 print(type(x))
x = 5 print(type(x)) x = '6' print(type(x)) x = 5.0 print(type(x)) x = 3.45 print(type(x))
class PythonApiException(Exception): pass class RepositoryException(PythonApiException): pass
class Pythonapiexception(Exception): pass class Repositoryexception(PythonApiException): pass
e = 10e-6 for b in range(10, 100): for a in range(10, b): r = a / b a1 = a % 10 a10 = (a // 10) % 10 b1 = b % 10 b10 = (b // 10) % 10 if a1 == b1 and a1 != 0 and b1 != 0: c = a10 d = b10 elif a1 == b10: c = a10 ...
e = 1e-05 for b in range(10, 100): for a in range(10, b): r = a / b a1 = a % 10 a10 = a // 10 % 10 b1 = b % 10 b10 = b // 10 % 10 if a1 == b1 and a1 != 0 and (b1 != 0): c = a10 d = b10 elif a1 == b10: c = a10 d =...
# https://codeforces.com/contest/520/problem/A def check_freq(x): freq = {} for c in set(x): freq[c] = x.count(c) return freq _ = input() word = input().lower() if len(check_freq(word)) == 26: print("YES") else: print("NO")
def check_freq(x): freq = {} for c in set(x): freq[c] = x.count(c) return freq _ = input() word = input().lower() if len(check_freq(word)) == 26: print('YES') else: print('NO')
s=0 for i in range(0,3): for j in range(0,3): for k in range(0,3): s+=1 print(s)
s = 0 for i in range(0, 3): for j in range(0, 3): for k in range(0, 3): s += 1 print(s)
bags = {} def get_bags(): with open("7/input.txt", "r") as file: data = file.read().split('\n') for line in data: parts = line.split(" contain ") color = parts[0].replace(" bags", "") contains = [] if parts[1] != "no other bags.": contains_bags = p...
bags = {} def get_bags(): with open('7/input.txt', 'r') as file: data = file.read().split('\n') for line in data: parts = line.split(' contain ') color = parts[0].replace(' bags', '') contains = [] if parts[1] != 'no other bags.': contains_bags = parts[1].spl...
load(":common.bzl", "get_nuget_files") load("//dotnet/private:context.bzl", "make_builder_cmd") load("//dotnet/private/actions:common.bzl", "cache_set", "declare_caches", "write_cache_manifest") load("//dotnet/private:providers.bzl", "DotnetRestoreInfo", "MSBuildDirectoryInfo", "NuGetPackageInfo") def restore(ctx, dot...
load(':common.bzl', 'get_nuget_files') load('//dotnet/private:context.bzl', 'make_builder_cmd') load('//dotnet/private/actions:common.bzl', 'cache_set', 'declare_caches', 'write_cache_manifest') load('//dotnet/private:providers.bzl', 'DotnetRestoreInfo', 'MSBuildDirectoryInfo', 'NuGetPackageInfo') def restore(ctx, dot...
def sum_digits(digit): return sum(int(x) for x in digit if x.isdigit()) print(sum_digits('texto123numero456x7')) #https://pt.stackoverflow.com/q/42280/101
def sum_digits(digit): return sum((int(x) for x in digit if x.isdigit())) print(sum_digits('texto123numero456x7'))
# # PySNMP MIB module NTNTECH-CHASSIS-CONFIGURATION-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NTNTECH-CHASSIS-CONFIGURATION-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:25:24 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using P...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, constraints_intersection, value_size_constraint, constraints_union) ...
load("@bazel_gazelle//:deps.bzl", "go_repository") def go_repositories(): go_repository( name = "com_github_deepmap_oapi_codegen", importpath = "github.com/deepmap/oapi-codegen", sum = "h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU=", version = "v1.8.2", ) go_repository( ...
load('@bazel_gazelle//:deps.bzl', 'go_repository') def go_repositories(): go_repository(name='com_github_deepmap_oapi_codegen', importpath='github.com/deepmap/oapi-codegen', sum='h1:SegyeYGcdi0jLLrpbCMoJxnUUn8GBXHsvr4rbzjuhfU=', version='v1.8.2') go_repository(name='com_github_cyberdelia_templates', importpath...
def get_days(datetime_1,datetime_2,work_timing,weekends,holidays_list): # Here a datetime without full work time still is count as a day first_day = datetime_1 days = 1 while(first_day.day < datetime_2.day): if((first_day.isoweekday() not in weekends) and (first_day.strftime("%Y-%m-%d") not in holid...
def get_days(datetime_1, datetime_2, work_timing, weekends, holidays_list): first_day = datetime_1 days = 1 while first_day.day < datetime_2.day: if first_day.isoweekday() not in weekends and first_day.strftime('%Y-%m-%d') not in holidays_list: days += 1 first_day += datetime.tim...
class DBController(): def insert(): pass def connect(): pass
class Dbcontroller: def insert(): pass def connect(): pass
def make_move(): board = [input().split() for _ in range(n)] my_ptr = 'R' if player == 'RED' else 'B' my_x = my_y = None for i, row in enumerate(board): for j, val in enumerate(row): if val == my_ptr: my_x = i my_y = j delta = [[0, -1, 'L'], [-1, 0...
def make_move(): board = [input().split() for _ in range(n)] my_ptr = 'R' if player == 'RED' else 'B' my_x = my_y = None for (i, row) in enumerate(board): for (j, val) in enumerate(row): if val == my_ptr: my_x = i my_y = j delta = [[0, -1, 'L'], [-...
class ImportLine: def __init__(self, fromString: str, importString: str): self.__from = fromString self.__import = importString def getFrom(self) -> str: return self.__from def getImport(self) -> str: return self.__import def isSame(self, line2: 'ImportLine') -> b...
class Importline: def __init__(self, fromString: str, importString: str): self.__from = fromString self.__import = importString def get_from(self) -> str: return self.__from def get_import(self) -> str: return self.__import def is_same(self, line2: 'ImportLine') -> bo...
nome = 'Djonatan ' sobrenome = 'Schvambach' print(nome + sobrenome) idade = 25 altura = 1.76 e_maior = idade > 18 print('Nome ' + nome + sobrenome + ' Idade ' + str(idade) + ' maior de Idade ? ' + str(e_maior) ) peso = 58 imc = peso / altura ** 2 print(imc)
nome = 'Djonatan ' sobrenome = 'Schvambach' print(nome + sobrenome) idade = 25 altura = 1.76 e_maior = idade > 18 print('Nome ' + nome + sobrenome + ' Idade ' + str(idade) + ' maior de Idade ? ' + str(e_maior)) peso = 58 imc = peso / altura ** 2 print(imc)
# Source : https://leetcode.com/problems/longest-common-prefix/ # Author : foxfromworld # Date : 04/10/2021 # First attempt class Solution: def longestCommonPrefix(self, strs: List[str]) -> str: strs.sort(key=len) result = "" char = set() for i in range(len(strs[0])): ...
class Solution: def longest_common_prefix(self, strs: List[str]) -> str: strs.sort(key=len) result = '' char = set() for i in range(len(strs[0])): for j in range(len(strs)): char.add(strs[j][i]) if len(char) > 1: return result ...
{ "targets": [ { "target_name": "memcachedNative", "sources": [ "src/init.cc", "src/client.cpp" ], "include_dirs": [ "<!(node -e \"require('nan')\")" ], 'link_settings': { 'libraries': [ '<!@(pkg-config --libs libmemcached)' ...
{'targets': [{'target_name': 'memcachedNative', 'sources': ['src/init.cc', 'src/client.cpp'], 'include_dirs': ['<!(node -e "require(\'nan\')")'], 'link_settings': {'libraries': ['<!@(pkg-config --libs libmemcached)']}}]}
def sisi(): a = 10.0; b = {}; c = "string" return a, b, c sisi()
def sisi(): a = 10.0 b = {} c = 'string' return (a, b, c) sisi()
s=input().split() graph_path = list() graph_path.append(s) for i in range(len(s)-1): graph_path.append(input().split()) print('path input done.') #print(graph_path) s=input().split() weight_path = list() weight_path.append(s) for i in range(len(s)-1): weight_path.append(input().split()) print('weight input don...
s = input().split() graph_path = list() graph_path.append(s) for i in range(len(s) - 1): graph_path.append(input().split()) print('path input done.') s = input().split() weight_path = list() weight_path.append(s) for i in range(len(s) - 1): weight_path.append(input().split()) print('weight input done.')
def word(): word = "CSPIsCool" x = "" for i in word: x += i print(x) def rows(): rows = 10 for i in range(1, rows + 1): for j in range(1, i + 1): print(i * j, end=' ') print() def pattern(): rows = 6 for i in range(0, rows): for j in range(rows - 1, i, -1): print(j, '...
def word(): word = 'CSPIsCool' x = '' for i in word: x += i print(x) def rows(): rows = 10 for i in range(1, rows + 1): for j in range(1, i + 1): print(i * j, end=' ') print() def pattern(): rows = 6 for i in range(0, rows): for j in rang...
# by adegunlehinabayomi@gmail.com # ______COVID-19 Impact Estimator_______ reportedCases = data_reported_cases population = data-population timeToElapse = data-time-to-elapse totalHospitalBeds = data-total-hospital-beds c_i = 0 iBRT = 0 #return reportedCases, population, timeToElapse, totalHospitalBeds # C...
reported_cases = data_reported_cases population = data - population time_to_elapse = data - time - to - elapse total_hospital_beds = data - total - hospital - beds c_i = 0 i_brt = 0 def currently_infected(r_c, check): if check == 'impact': impact_currently_infected = reportedCases * 10 c_i = impact...
possibleprograms = ["Example.exe", "ExampleNr2.exe", "Pavlov-Win64-Shipping.exe"] programdisplaynames = { "Example.exe": "Example", "ExampleNr2.exe": "Whatever name should be displayed", "Pavlov-Win64-Shipping.exe": "Pavlov" } presets = [ [["Spotify.e...
possibleprograms = ['Example.exe', 'ExampleNr2.exe', 'Pavlov-Win64-Shipping.exe'] programdisplaynames = {'Example.exe': 'Example', 'ExampleNr2.exe': 'Whatever name should be displayed', 'Pavlov-Win64-Shipping.exe': 'Pavlov'} presets = [[['Spotify.exe', 0.0], ['firefox.exe', 0.5]], [['Spotify.exe', 0.5], ['firefox.exe',...
class _BotCommands: def __init__(self): self.StartCommand = 'start' self.MirrorCommand = 'mirror' self.UnzipMirrorCommand = 'unzipmirror' self.TarMirrorCommand = 'tarmirror' self.CancelMirror = 'cancel' self.CancelAllCommand = 'cancelall' self.ListCommand = 'l...
class _Botcommands: def __init__(self): self.StartCommand = 'start' self.MirrorCommand = 'mirror' self.UnzipMirrorCommand = 'unzipmirror' self.TarMirrorCommand = 'tarmirror' self.CancelMirror = 'cancel' self.CancelAllCommand = 'cancelall' self.ListCommand = '...
def CorsMiddleware(app): def _set_headers(headers): headers.append(('Access-Control-Allow-Origin', '*')) headers.append(('Access-Control-Allow-Methods', '*')) headers.append(('Access-Control-Allow-Headers', 'origin, content-type, accept')) return headers def middleware(environ,...
def cors_middleware(app): def _set_headers(headers): headers.append(('Access-Control-Allow-Origin', '*')) headers.append(('Access-Control-Allow-Methods', '*')) headers.append(('Access-Control-Allow-Headers', 'origin, content-type, accept')) return headers def middleware(environ...
#IMPRIMIR UMA PALAVRA INSERIDA INVERTIDAMENTE if __name__ == "__main__": palavra = input() for index in range(len(palavra) - 1, -1, -1): print(palavra[index], end='')
if __name__ == '__main__': palavra = input() for index in range(len(palavra) - 1, -1, -1): print(palavra[index], end='')
class Solution: def minMalwareSpread(self, graph: List[List[int]], initial: List[int]) -> int: if not graph: return -1 N = len(graph) clean = set(range(N)) - set(initial) parents = list(range(N)) size = [1] * N def find(x): if parents[x] != x: ...
class Solution: def min_malware_spread(self, graph: List[List[int]], initial: List[int]) -> int: if not graph: return -1 n = len(graph) clean = set(range(N)) - set(initial) parents = list(range(N)) size = [1] * N def find(x): if parents[x] !=...
class Person: id = None name = None def __init__(self, id=None, name=None): self.id = id self.name = name
class Person: id = None name = None def __init__(self, id=None, name=None): self.id = id self.name = name
def sort_gift_code(code: str) -> str: my_letter = [] for letter in code: my_letter.append(letter) return ''.join(sorted(my_letter))
def sort_gift_code(code: str) -> str: my_letter = [] for letter in code: my_letter.append(letter) return ''.join(sorted(my_letter))
# # PySNMP MIB module PACKETEER-RTM-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PACKETEER-RTM-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:36:08 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, value_size_constraint, value_range_constraint, constraints_union) ...
i = 0 #defines an integer i while(i<119): #while i is less than 119, do the following print(i) #prints the current value of i i += 10 #add 10 to i
i = 0 while i < 119: print(i) i += 10
# print(111) def main(): p = { 'a':1, 'b':2, 'c':3, 'd':4, 'e':5 } print(p) print('i' in p.keys()) if __name__ == '__main__': main()
def main(): p = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5} print(p) print('i' in p.keys()) if __name__ == '__main__': main()
DEPRECATION_WARNING = ( "WARNING: We will end support of the ArcGIS interface by the 1st of May of 2019. This means that there will " "not be anymore tutorials nor advice on how to use this interface. You could still use this interface on " "your own. We invite all CEA users to get acquainted with the CEA D...
deprecation_warning = 'WARNING: We will end support of the ArcGIS interface by the 1st of May of 2019. This means that there will not be anymore tutorials nor advice on how to use this interface. You could still use this interface on your own. We invite all CEA users to get acquainted with the CEA Dashboard. The CEA da...
# coding: utf-8 test_group = 'test_group' test_event = 'test_event' test_value_str = 'test_value' test_value_int = 123 test_value_int_zero = 0 test_value_float = 123.0 test_value_float_zero = 0.0 test_value_none = None test_label = 'test_label' test_value_list = [ test_value_str, test_value_int, test_value_floa...
test_group = 'test_group' test_event = 'test_event' test_value_str = 'test_value' test_value_int = 123 test_value_int_zero = 0 test_value_float = 123.0 test_value_float_zero = 0.0 test_value_none = None test_label = 'test_label' test_value_list = [test_value_str, test_value_int, test_value_float, test_value_int_zero, t...
# This file is auto-generated. Do not edit! DAQmx_Buf_Input_BufSize = 0x186C DAQmx_Buf_Input_OnbrdBufSize = 0x230A DAQmx_Buf_Output_BufSize = 0x186D DAQmx_Buf_Output_OnbrdBufSize = 0x230B DAQmx_SelfCal_Supported = 0x1860 DAQmx_SelfCal_LastTemp = 0x1864 DAQmx_ExtCal_RecommendedInterval = 0x1868 DAQmx_ExtCal_LastTemp = 0...
da_qmx__buf__input__buf_size = 6252 da_qmx__buf__input__onbrd_buf_size = 8970 da_qmx__buf__output__buf_size = 6253 da_qmx__buf__output__onbrd_buf_size = 8971 da_qmx__self_cal__supported = 6240 da_qmx__self_cal__last_temp = 6244 da_qmx__ext_cal__recommended_interval = 6248 da_qmx__ext_cal__last_temp = 6247 da_qmx__cal__...
principal=int(input("Enter the Principal amount")) year=int(input("Enter the no. of Years")) rateofinterest=int(input("Enter the Rate of Interest. Just enter the number")) amount=principal*((1+rateofinterest/100)**year) compoundinterest = amount-principal print(f"Compound Interest is {compoundinterest} Rupees") p...
principal = int(input('Enter the Principal amount')) year = int(input('Enter the no. of Years')) rateofinterest = int(input('Enter the Rate of Interest. Just enter the number')) amount = principal * (1 + rateofinterest / 100) ** year compoundinterest = amount - principal print(f'Compound Interest is {compoundinterest} ...
def div42by(divideBy): return 42 / divideBy print (div42by(2)) print (div42by(12)) print (div42by(0)) print (div42by(1))
def div42by(divideBy): return 42 / divideBy print(div42by(2)) print(div42by(12)) print(div42by(0)) print(div42by(1))
result = {title: str(i) for i, titles in DATA.items() for title in titles}
result = {title: str(i) for (i, titles) in DATA.items() for title in titles}
INCIDENTS_RESULT = [ {'ModuleName': 'InnerServicesModule', 'Brand': 'Builtin', 'Category': 'Builtin', 'ID': '', 'Version': 0, 'Type': 1, 'Contents': { 'ErrorsPrivateDoNotUse': None, 'data': [ { 'CustomFields': {'dbotpredictionprobability': 0, ...
incidents_result = [{'ModuleName': 'InnerServicesModule', 'Brand': 'Builtin', 'Category': 'Builtin', 'ID': '', 'Version': 0, 'Type': 1, 'Contents': {'ErrorsPrivateDoNotUse': None, 'data': [{'CustomFields': {'dbotpredictionprobability': 0, 'detectionsla': {'accumulatedPause': 0, 'breachTriggered': False, 'dueDate': '000...
class Event: def __init__(self, label=None, half=None, time=None, team=None, position= None, visibility=None): self.label = label self.half = half self.time = time self.team = team self.position = position self.visibility = visibility def to_text(self): return self.time + " || " + self.label + " - ...
class Event: def __init__(self, label=None, half=None, time=None, team=None, position=None, visibility=None): self.label = label self.half = half self.time = time self.team = team self.position = position self.visibility = visibility def to_text(self): r...