content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# # PySNMP MIB module DOT3-OAM-MIB (http://pysnmp.sf.net) # ASN.1 source http://mibs.snmplabs.com:80/asn1/DOT3-OAM-MIB # Produced by pysmi-0.0.7 at Sun Feb 14 00:10:39 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:52) # ( In...
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, constraints_intersection, single_value_constraint, value_size_constraint) ...
# base class FyException(Exception): def __init__(s, message): s.message = '\n;;;;;\n' s.message += s.__class__.__name__.replace('_', ' ') s.message += '\n' s.message += str(message) def __str__(s): return s.message # exception class a_function_cannot_be_dotted(FyException): pass class cannot_indent_on_...
class Fyexception(Exception): def __init__(s, message): s.message = '\n;;;;;\n' s.message += s.__class__.__name__.replace('_', ' ') s.message += '\n' s.message += str(message) def __str__(s): return s.message class A_Function_Cannot_Be_Dotted(FyException): pass cl...
# Palanquin (9110107) | Outside Ninja Castle (800040000) mushroomShrine = 800000000 response = sm.sendAskYesNo("Would you like to go to #m" + str(mushroomShrine) + "m#?") if response: sm.warp(mushroomShrine)
mushroom_shrine = 800000000 response = sm.sendAskYesNo('Would you like to go to #m' + str(mushroomShrine) + 'm#?') if response: sm.warp(mushroomShrine)
f = open("./three.txt", "r") lines = [x.strip() for x in f.readlines()] gamma = "" for index in range(len(lines[0])): bits = [line[index] for line in lines] zeros = list(bits).count('0') ones = list(bits).count('1') if zeros > ones: gamma += "0" else: gamma += "1" epsilon = "" for...
f = open('./three.txt', 'r') lines = [x.strip() for x in f.readlines()] gamma = '' for index in range(len(lines[0])): bits = [line[index] for line in lines] zeros = list(bits).count('0') ones = list(bits).count('1') if zeros > ones: gamma += '0' else: gamma += '1' epsilon = '' for in...
#!/usr/bin/python # # Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
in = None inout = None file_in = None file_out = None file_inout = None collection_in = None collection_inout = None collection_out = None type = 'type' direction = 'direction' std_io_stream = 'stream' prefix = 'prefix' depth = 'depth' block_count = 'block_count' block_length = 'block_length' stride = 'stride'
def bin_search_lower(a, x): l, r = -1, len(a) while l + 1 < r: m = (l + r) // 2 if a[m] <= x: l = m else: r = m return l n, k = map(int, input().split()) array = list(map(int, input().split())) for x in map(int, input().split()): print(bin_search_lower(...
def bin_search_lower(a, x): (l, r) = (-1, len(a)) while l + 1 < r: m = (l + r) // 2 if a[m] <= x: l = m else: r = m return l (n, k) = map(int, input().split()) array = list(map(int, input().split())) for x in map(int, input().split()): print(bin_search_low...
class State: def __init__(self, client) -> None: self.client = client def get_input_command(self): return input(f"JogoDaVelha> ").strip().split() or [""] def handle_input_command(self, *input_command): pass def handle_opponent_command(self, *command): pass def han...
class State: def __init__(self, client) -> None: self.client = client def get_input_command(self): return input(f'JogoDaVelha> ').strip().split() or [''] def handle_input_command(self, *input_command): pass def handle_opponent_command(self, *command): pass def ha...
#!/usr/bin/env python # -*- coding: utf-8 -*- spinMultiplicity = 2 energy = { 'CCSD(T)-F12/cc-pVTZ-F12': MolproLog('TSN09_f12.out'), } frequencies = GaussianLog('ts3-freq.log') rotors = [HinderedRotor(scanLog=ScanLog('scan_0.log'), pivots=[4,10], top=[10,11,12,13,14], symmetry=1, fit='best'), HinderedRotor(scanLog=...
spin_multiplicity = 2 energy = {'CCSD(T)-F12/cc-pVTZ-F12': molpro_log('TSN09_f12.out')} frequencies = gaussian_log('ts3-freq.log') rotors = [hindered_rotor(scanLog=scan_log('scan_0.log'), pivots=[4, 10], top=[10, 11, 12, 13, 14], symmetry=1, fit='best'), hindered_rotor(scanLog=scan_log('scan_1.log'), pivots=[10, 13], t...
a, b = map(int, input().split()) a = str(a) b = str(b) count = 0 c = int(a) d = int(b) for i in range(c, d + 1): i = str(i) if i[0] == i[4] and i[1] == i[3]: count += 1 print(count)
(a, b) = map(int, input().split()) a = str(a) b = str(b) count = 0 c = int(a) d = int(b) for i in range(c, d + 1): i = str(i) if i[0] == i[4] and i[1] == i[3]: count += 1 print(count)
#!/usr/local/bin/python # coding: utf-8 VERSION = '2.1.1' # 0: CRITICAL, 1: INFO, 2: DEBUG VERBOSE_LEVEL = 1 # 0: CONSOLE, 1: FILE, 2: CONSOLE & FILE LOG_TYPE = 0 LOG_DIR = 'output' HTML = False DEBUG = True
version = '2.1.1' verbose_level = 1 log_type = 0 log_dir = 'output' html = False debug = True
class Human: def __init__(self, name, age): self.name = name self.age = age def greeting(self): print(f"Hello {self.name}!") def get_name(self): return self.name def get_age(self): return self.age def set_age(self, age): self.ag...
class Human: def __init__(self, name, age): self.name = name self.age = age def greeting(self): print(f'Hello {self.name}!') def get_name(self): return self.name def get_age(self): return self.age def set_age(self, age): self.age = age h = human('...
class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: num_len = len(nums) prefix_products, postfix_products = [1] * (num_len + 1), [1] * (num_len + 1) prefix_product, postfix_product = 1, 1 for prefix_index in range(num_len): prefix_product *= nu...
class Solution: def product_except_self(self, nums: List[int]) -> List[int]: num_len = len(nums) (prefix_products, postfix_products) = ([1] * (num_len + 1), [1] * (num_len + 1)) (prefix_product, postfix_product) = (1, 1) for prefix_index in range(num_len): prefix_product...
CREATE_GAME = 'game_create' JOIN_GAME = 'game_join' LEAVE_GAME = 'game_abort' SET_NICK = 'nickname_set' INIT_BOARD = 'board_init' FIRE = 'attack' NUKE = 'special_attack' MOVE = 'move' SURRENDER = 'surrender' CHAT_SEND = 'chat_send'
create_game = 'game_create' join_game = 'game_join' leave_game = 'game_abort' set_nick = 'nickname_set' init_board = 'board_init' fire = 'attack' nuke = 'special_attack' move = 'move' surrender = 'surrender' chat_send = 'chat_send'
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode: if not l1: return l2 if not l2: return l1 r...
class Solution: def merge_two_lists(self, l1: ListNode, l2: ListNode) -> ListNode: if not l1: return l2 if not l2: return l1 res = list_node(-1) if l1.val < l2.val: res.val = l1.val res.next = self.mergeTwoLists(l1.next, l2) el...
odds = {1, 3, 5, 7} evens = set([0, 2, 4, 6, 8]) print(odds.union(evens)) odds.intersection() odds.difference()
odds = {1, 3, 5, 7} evens = set([0, 2, 4, 6, 8]) print(odds.union(evens)) odds.intersection() odds.difference()
def f1(): print(11) yield print(22) yield print(33) def f2(): print(55) yield print(66) yield print(77) v1 = f1() v2 = f2() next(v1) # v1.send(None) next(v2) # v1.send(None) next(v1) # v1.send(None) next(v2) # v1.send(None) next(v1) # v1.send(None) next(v2) # v1.send(N...
def f1(): print(11) yield print(22) yield print(33) def f2(): print(55) yield print(66) yield print(77) v1 = f1() v2 = f2() next(v1) next(v2) next(v1) next(v2) next(v1) next(v2)
## Gerenators def mygenerator(x): for i in range(x): yield i values = mygenerator(100) for i in values: print(i) print(next(mygenerator))
def mygenerator(x): for i in range(x): yield i values = mygenerator(100) for i in values: print(i) print(next(mygenerator))
class Node: def __init__(self, key): self.key = key self.child = [] def newNode(key): temp = Node(key) return temp def LevelOrderTraversal(root): if (root == None): return; # Standard level order traversal code # using queue q = [] # Create a queue q.append(...
class Node: def __init__(self, key): self.key = key self.child = [] def new_node(key): temp = node(key) return temp def level_order_traversal(root): if root == None: return q = [] q.append(root) while len(q) != 0: n = len(q) while n > 0: ...
def add_up(nums): return sum(nums) def test_answer(): assert add_up([1,2,2]) == 5
def add_up(nums): return sum(nums) def test_answer(): assert add_up([1, 2, 2]) == 5
#!/usr/bin/python3 def read_file(filename=""): '''open a given file''' with open(filename, 'r') as f: print("{}".format(f.read()), end="")
def read_file(filename=''): """open a given file""" with open(filename, 'r') as f: print('{}'.format(f.read()), end='')
class Node: def __init__(self, x, y): self.g = 0 self.h = 0 self.f = 0 self.parent = None self.cost = 1 self.x = x self.y = y self.left_child = None self.right_child = None self.top_child = None self.down_child = None def u...
class Node: def __init__(self, x, y): self.g = 0 self.h = 0 self.f = 0 self.parent = None self.cost = 1 self.x = x self.y = y self.left_child = None self.right_child = None self.top_child = None self.down_child = None def ...
def clever_format(num, format="%.2f"): if num > 1e12: return format % (num / 1e12) + "T" if num > 1e9: return format % (num / 1e9) + "G" if num > 1e6: return format % (num / 1e6) + "M" if num > 1e3: return format % (num / 1e3) + "K"
def clever_format(num, format='%.2f'): if num > 1000000000000.0: return format % (num / 1000000000000.0) + 'T' if num > 1000000000.0: return format % (num / 1000000000.0) + 'G' if num > 1000000.0: return format % (num / 1000000.0) + 'M' if num > 1000.0: return format % (n...
n,k=map(int,input().split()) x=sorted(list(map(int,input().split()))) a=[] for i in range(n-k+1): l=x[i] r=x[i+k-1] a.append(min(abs(l)+abs(r-l),abs(r)+abs(l-r))) print(min(a))
(n, k) = map(int, input().split()) x = sorted(list(map(int, input().split()))) a = [] for i in range(n - k + 1): l = x[i] r = x[i + k - 1] a.append(min(abs(l) + abs(r - l), abs(r) + abs(l - r))) print(min(a))
class Cell: def __init__(self, alive = False): self.currentState = alive self.futureState = alive def updateState(self, state): self.futureState = state def refresh(self): self.currentState = self.futureState def isAlive(self): return self.cur...
class Cell: def __init__(self, alive=False): self.currentState = alive self.futureState = alive def update_state(self, state): self.futureState = state def refresh(self): self.currentState = self.futureState def is_alive(self): return self.currentState de...
str1 = input() str2 = input() a = [0 for i in range(0,27)] for i in str1: a[ord(i)-ord('a')] += 1 for i in str2: a[ord(i)-ord('a')] -= 1 ans = 0 for i in a: if ( i < 0 ): ans += -i else: ans += i print(ans)
str1 = input() str2 = input() a = [0 for i in range(0, 27)] for i in str1: a[ord(i) - ord('a')] += 1 for i in str2: a[ord(i) - ord('a')] -= 1 ans = 0 for i in a: if i < 0: ans += -i else: ans += i print(ans)
def serializeCgiToServer(coors): #coors is a n by 2 2D array of doubles string = "" for i in range(0, len(coors)): string += str(coors[i][0]) + "," + str(coors[i][1]) # add comma between x and y coor string += ";" # add semicolon to seperate coors string += "\n" #ending character return ...
def serialize_cgi_to_server(coors): string = '' for i in range(0, len(coors)): string += str(coors[i][0]) + ',' + str(coors[i][1]) string += ';' string += '\n' return string.encode('utf-8') def deserialize_cgi_to_server(string): string = string.decode('utf-8') splitted = string....
# # PySNMP MIB module CISCOSB-SENSORENTMIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCOSB-SENSORENTMIB # Produced by pysmi-0.3.4 at Wed May 1 12:23:27 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (defau...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, single_value_constraint, value_size_constraint, value_range_constraint) ...
count = 0 fields = ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"] hex_not = "1234567890abcdef" ecls = ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"] def check_pprt(pprt): global count flag = True i = 0 while flag and i < len(fields): flag = flag and fields[i] in pprt i = i + 1 ...
count = 0 fields = ['byr', 'iyr', 'eyr', 'hgt', 'hcl', 'ecl', 'pid'] hex_not = '1234567890abcdef' ecls = ['amb', 'blu', 'brn', 'gry', 'grn', 'hzl', 'oth'] def check_pprt(pprt): global count flag = True i = 0 while flag and i < len(fields): flag = flag and fields[i] in pprt i = i + 1 ...
#OPERATOR PENUGASAN #input mengisi nilai nilai_x=int(input("masukan nilai x: ")) #operator penjumlahan nilai_x +=20 print("hasil jumlah: ", nilai_x) nilai_x=int(input("masukan nilai x: ")) #operator pengurangan nilai_x -=10 print("hasil kurang:",nilai_x) nilai_x=int(input("masukan nilai x: ")) #opera...
nilai_x = int(input('masukan nilai x: ')) nilai_x += 20 print('hasil jumlah: ', nilai_x) nilai_x = int(input('masukan nilai x: ')) nilai_x -= 10 print('hasil kurang:', nilai_x) nilai_x = int(input('masukan nilai x: ')) nilai_x *= 10 print('hasil kali:', nilai_x) nilai_x = int(input('masukan nilai x: ')) nilai_x /= 30 p...
#author SANKALP SAXENA # Enter your code here. Read input from STDIN. Print output to STDOUT n = int(input()) s = set() for i in range(0, n) : s.add(input()) print(len(s))
n = int(input()) s = set() for i in range(0, n): s.add(input()) print(len(s))
def swap_case(s): swapped = s.swapcase() return swapped
def swap_case(s): swapped = s.swapcase() return swapped
#----------------------------------------------------------------------------- # Runtime: 84ms # Memory Usage: # Link: #----------------------------------------------------------------------------- class Solution: def multiply(self, num1: str, num2: str) -> str: if num1 == '0' or num2 == '0': ...
class Solution: def multiply(self, num1: str, num2: str) -> str: if num1 == '0' or num2 == '0': return '0' len_num1 = len(num1) len_num2 = len(num2) num1 = num1[::-1] num2 = num2[::-1] result_list = [0] * 220 dic = {'0': 0, '1': 1, '2': 2, '3': 3,...
# program that takes a text file as input and returns the number of words of a given text file. def count_words(filepath): with open(filepath) as f: data = f.read() data.replace(",", " ") return len(data.split(" ")) print(count_words("words.txt"))
def count_words(filepath): with open(filepath) as f: data = f.read() data.replace(',', ' ') return len(data.split(' ')) print(count_words('words.txt'))
#get the user input for Position position = input("Position : ") while position != "M" and position != "m" and position != "S" and position != "s": print("Invalid Input") position = input("Position : ") #get the user input for sales amount sales = input("Sales amount : ") sales = float(sales) #get the basic ...
position = input('Position : ') while position != 'M' and position != 'm' and (position != 'S') and (position != 's'): print('Invalid Input') position = input('Position : ') sales = input('Sales amount : ') sales = float(sales) if position == 'M' or position == 'm': basic = 50000 else: basic = 75000 if ...
# Created by MechAviv # Quest ID :: 23600 # Not coded yet OBJECT_6 = sm.getIntroNpcObjectID(2159377) sm.curNodeEventEnd(True) sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(True, True, False, False) sm.sendDelay(900) sm.moveCamera(False, 100, -307, -41) sm.sendDelay(2604) sm.setSpeakerID(2159377) sm.remove...
object_6 = sm.getIntroNpcObjectID(2159377) sm.curNodeEventEnd(True) sm.setTemporarySkillSet(0) sm.setInGameDirectionMode(True, True, False, False) sm.sendDelay(900) sm.moveCamera(False, 100, -307, -41) sm.sendDelay(2604) sm.setSpeakerID(2159377) sm.removeEscapeButton() sm.setSpeakerType(3) sm.sendNext('Good, very good!...
rgb = input() rgb = rgb.replace(" ", "") if int(rgb) % 4 == 0: print("YES") else: print("NO")
rgb = input() rgb = rgb.replace(' ', '') if int(rgb) % 4 == 0: print('YES') else: print('NO')
def main() -> None: n = int(input()) def f(a: int, b: int) -> int: return a**3 + (a + b) * a * b + b**3 def binary_search(a: int) -> int: lo = -1 hi = 1 << 20 while hi - lo > 1: # print(lo, hi) b = (lo + hi) // 2 if f(a, b) >=...
def main() -> None: n = int(input()) def f(a: int, b: int) -> int: return a ** 3 + (a + b) * a * b + b ** 3 def binary_search(a: int) -> int: lo = -1 hi = 1 << 20 while hi - lo > 1: b = (lo + hi) // 2 if f(a, b) >= n: hi = b ...
def raw_response(function=None): def decorator(function): function.raw_response = True return function if function: return decorator(function) return decorator
def raw_response(function=None): def decorator(function): function.raw_response = True return function if function: return decorator(function) return decorator
class StringBuilder(object): def __init__(self, strr=''): self.str_list = [s for s in strr] def __getitem__(self, item): return ''.join(self.str_list[item]) def __setitem__(self, key, value): self.str_list[key] = value def __repr__(self): return ''.join(self.str_lis...
class Stringbuilder(object): def __init__(self, strr=''): self.str_list = [s for s in strr] def __getitem__(self, item): return ''.join(self.str_list[item]) def __setitem__(self, key, value): self.str_list[key] = value def __repr__(self): return ''.join(self.str_list)...
#from math import hypot co = float(input('Quanto mede o cateto oposto? ')) ca = float(input('Quanto mede o cateto adjacente? ')) hi = hypot(co, ca) print(f'A hipotenusa vai medir {hi:.2f}') ''' import math co = float(input('Quanto mede o cateto oposto? ')) ca = float(input('Quanto mede o cateto adjacente? ')) hi = mat...
co = float(input('Quanto mede o cateto oposto? ')) ca = float(input('Quanto mede o cateto adjacente? ')) hi = hypot(co, ca) print(f'A hipotenusa vai medir {hi:.2f}') "\nimport math\nco = float(input('Quanto mede o cateto oposto? '))\nca = float(input('Quanto mede o cateto adjacente? '))\nhi = math.hypot(co, ca)\nprint(...
class Person: IS = None def __init__(self, name, hours, rate): self.name = name self.hours = hours self.rate = rate def __new__(cls, *args, **kwargs): if cls.IS == None: cls.IS = object.__new__(Person) return cls.IS def pay(self): r...
class Person: is = None def __init__(self, name, hours, rate): self.name = name self.hours = hours self.rate = rate def __new__(cls, *args, **kwargs): if cls.IS == None: cls.IS = object.__new__(Person) return cls.IS def pay(self): return sel...
data_matrix = [ [2, 3, 1, 1], [1, 2, 3, 1], [1, 1, 2, 3], [3, 1, 1, 2] ] def fill_zeros(data_val): return bin(int(data_val, 16))[2:].zfill(8) input_hex = [0xd4, 0xbf, 0x5d, 0x30] input_bin = [] for i, bi...
data_matrix = [[2, 3, 1, 1], [1, 2, 3, 1], [1, 1, 2, 3], [3, 1, 1, 2]] def fill_zeros(data_val): return bin(int(data_val, 16))[2:].zfill(8) input_hex = [212, 191, 93, 48] input_bin = [] for (i, bin_num) in enumerate(input_hex): bin_num = bin(input_hex[i])[2:].zfill(8) print(bin_num) bin_num = int(bin_n...
Root.default = -3 Scale.default = 'minor' Clock.bpm=100 acordes = [(2,4,6),(-1,1,3),(0,2,4)] escalera = P[5,4,3,2] p1 >> space([0,0,4,2,0,0,5,2],dur=1,amp=[0,1,1,1]) d1 >> play("X ",amp=1) pt >> play('#', dur=16,sus=4, rate=-1/2, amp=var([1,0],[16,inf],start=now)) p1 >> space([4,4,2,0,3,3,2,1],dur=1,amp=[0,1,1,1]) p...
Root.default = -3 Scale.default = 'minor' Clock.bpm = 100 acordes = [(2, 4, 6), (-1, 1, 3), (0, 2, 4)] escalera = P[5, 4, 3, 2] p1 >> space([0, 0, 4, 2, 0, 0, 5, 2], dur=1, amp=[0, 1, 1, 1]) d1 >> play('X ', amp=1) pt >> play('#', dur=16, sus=4, rate=-1 / 2, amp=var([1, 0], [16, inf], start=now)) p1 >> space([4, 4, 2, ...
def main(): totalNum = 0 totalValues = {} filename = 'day1_1_input.txt' found = False while not found: userInput = open(filename, 'r') print ("Starting from the top") for i in userInput: print (i) if i[0] == '-': totalNum -= int(i[1:]) ...
def main(): total_num = 0 total_values = {} filename = 'day1_1_input.txt' found = False while not found: user_input = open(filename, 'r') print('Starting from the top') for i in userInput: print(i) if i[0] == '-': total_num -= int(i[1:]...
def response(hey_bob): hey_bob = hey_bob.strip() if _is_silence(hey_bob): return 'Fine. Be that way!' if _is_shouting(hey_bob): if _is_question(hey_bob): return "Calm down, I know what I'm doing!" else: return 'Whoa, chill out!' elif _is_question(hey_bob)...
def response(hey_bob): hey_bob = hey_bob.strip() if _is_silence(hey_bob): return 'Fine. Be that way!' if _is_shouting(hey_bob): if _is_question(hey_bob): return "Calm down, I know what I'm doing!" else: return 'Whoa, chill out!' elif _is_question(hey_bob):...
word = input("Enter a number: ") word = int(word) count =10 while True: temp = word % 10 word = word//10 if temp % 2==0: print(temp,end="") if word == 0: break
word = input('Enter a number: ') word = int(word) count = 10 while True: temp = word % 10 word = word // 10 if temp % 2 == 0: print(temp, end='') if word == 0: break
data = input() products = {} while not data == "statistics": product, quantity = data.split(": ") quantity = int(quantity) if product in products: products[product] += quantity else: products[product] = quantity data = input() print("Products in stock:") for product in products: ...
data = input() products = {} while not data == 'statistics': (product, quantity) = data.split(': ') quantity = int(quantity) if product in products: products[product] += quantity else: products[product] = quantity data = input() print('Products in stock:') for product in products: ...
# static methods # use the staticmethod decorator class Human: @staticmethod def speak(): print("I can speak") Human().speak() me = Human() me.speak() # this line will give error # expected an error.. but there isn't any # static methods can be called on an instance of a class # i didn't pass self or any arg...
class Human: @staticmethod def speak(): print('I can speak') human().speak() me = human() me.speak()
# Sem passar valores pelo init class Calculadora: # def __init__(self): # pass def soma(self, valor_a, valor_b): return valor_a + valor_b def subtracao(self, valor_a, valor_b): return valor_a - valor_b def multiplicacao(self, valor_a, valor_b): return valor_a * valor_...
class Calculadora: def soma(self, valor_a, valor_b): return valor_a + valor_b def subtracao(self, valor_a, valor_b): return valor_a - valor_b def multiplicacao(self, valor_a, valor_b): return valor_a * valor_b def divisao(self, valor_a, valor_b): return valor_a / valo...
def get_level(cell): i = 0 while cell > (2*i+1)**2: i += 1 return i def find_coord(cell): level = get_level(cell) x = level y = -level current = (2*level+1)**2 while x != -level: if current == cell: return (x, y) x-=1 current -= 1 while y !...
def get_level(cell): i = 0 while cell > (2 * i + 1) ** 2: i += 1 return i def find_coord(cell): level = get_level(cell) x = level y = -level current = (2 * level + 1) ** 2 while x != -level: if current == cell: return (x, y) x -= 1 current -= ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Filename: for.py edibles = ['ham', 'spam', 'eggs', 'nuts'] for food in edibles: if food == 'spam': print('No more spam please!') break print('Great, delicious ' + food) else: print('I am so glad: No spam!') print('Finally, I finished stuffing...
edibles = ['ham', 'spam', 'eggs', 'nuts'] for food in edibles: if food == 'spam': print('No more spam please!') break print('Great, delicious ' + food) else: print('I am so glad: No spam!') print('Finally, I finished stuffing myself')
class QuoteLine: def __init__(self, lineText, lineNumber, origin): self.lineText = lineText self.lineNumber = lineNumber self.origin = origin self.renderedLine = None def renderLine(self, font, color): ''' Renders the line using the given font and color. ''' self.renderedLine = font.render(self.l...
class Quoteline: def __init__(self, lineText, lineNumber, origin): self.lineText = lineText self.lineNumber = lineNumber self.origin = origin self.renderedLine = None def render_line(self, font, color): """ Renders the line using the given font and color. """ ...
first_str = input() second_str = input() while first_str in second_str: second_str = second_str.replace(first_str, '') print(second_str)
first_str = input() second_str = input() while first_str in second_str: second_str = second_str.replace(first_str, '') print(second_str)
# # PySNMP MIB module CHIPFDDINET-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CHIPFDDINET-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:48:56 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27...
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_size_constraint, value_range_constraint, constraints_union, constraints_intersection) ...
print(10/3) print(10//3) print() kue = 16 anak = 4 kuePerAnak = kue // anak print ("Setiap anak akan mendapatkan kue sebanyak ", kuePerAnak)
print(10 / 3) print(10 // 3) print() kue = 16 anak = 4 kue_per_anak = kue // anak print('Setiap anak akan mendapatkan kue sebanyak ', kuePerAnak)
while True: X, M = map(int, input().split()) if X == 0 and M == 0: break Y = X * M print(Y)
while True: (x, m) = map(int, input().split()) if X == 0 and M == 0: break y = X * M print(Y)
age = 5+(8%3)-3+(3*10)/2 greetings = "Welcome to IEEE Python Workshop 2018 edition. It's my pleasure to conduct today's workshop for you." name = "Saurabh Mudgal" major = "mechanical engineering" print(greetings) print("My name is " + name + ".") print("I am " + str(age) + " years old and am majoring in " + major + "....
age = 5 + 8 % 3 - 3 + 3 * 10 / 2 greetings = "Welcome to IEEE Python Workshop 2018 edition. It's my pleasure to conduct today's workshop for you." name = 'Saurabh Mudgal' major = 'mechanical engineering' print(greetings) print('My name is ' + name + '.') print('I am ' + str(age) + ' years old and am majoring in ' + maj...
# -*- coding: utf-8 -*- __title__ = 'exp_mixture_model' __version__ = '1.0.0' __description__ = 'Maximum likelihood estimation and model selection of EMMs' __copyright__ = 'Copyright (C) 2019 Makoto Okada and Naoki Masuda' __license__ = 'MIT License' __author__ = 'Makoto Okada, Kenji Yamanishi and Naoki Masuda' __auth...
__title__ = 'exp_mixture_model' __version__ = '1.0.0' __description__ = 'Maximum likelihood estimation and model selection of EMMs' __copyright__ = 'Copyright (C) 2019 Makoto Okada and Naoki Masuda' __license__ = 'MIT License' __author__ = 'Makoto Okada, Kenji Yamanishi and Naoki Masuda' __author_email__ = 'naoki.masud...
class Product: def __init__(self, name, category_name, unit_price): self.name = name self.category_name = category_name self.unit_price = unit_price def __str__(self): return f"Nazwa: {self.name} | Kategoria: {self.category_name} | Cena: {self.unit_price} PLN/szt"
class Product: def __init__(self, name, category_name, unit_price): self.name = name self.category_name = category_name self.unit_price = unit_price def __str__(self): return f'Nazwa: {self.name} | Kategoria: {self.category_name} | Cena: {self.unit_price} PLN/szt'
class Shape: def __init__(self): self.data = ['_' for _ in range(10)] def print_out(self): print(''.join(self.data)) class Even(Shape): def draw_func(self, x): if x % 2 == 0: return True else: return False class ThirdBiggerFive(Shape): def draw_f...
class Shape: def __init__(self): self.data = ['_' for _ in range(10)] def print_out(self): print(''.join(self.data)) class Even(Shape): def draw_func(self, x): if x % 2 == 0: return True else: return False class Thirdbiggerfive(Shape): def dr...
#!/usr/bin/python3 # steinkirch at gmail.com # astro.sunysb.edu/steinkirch class Node(object): def __init__(self, value=None): self.value = value self.next = None class Stack(object): def __init__(self): self.top = None def push(self, item): node = Node(item) node...
class Node(object): def __init__(self, value=None): self.value = value self.next = None class Stack(object): def __init__(self): self.top = None def push(self, item): node = node(item) node.next = self.top self.top = node def pop(self): if sel...
def lmap(f, it): return list(map(f, it)) def ints(it): return lmap(int, it) def solve(input): l = len(input.split()[0]) xs = lmap(lambda x: int(x, 2), input.split()) a = 0 for i in range(l): cnt = [0, 0] for x in xs: cnt[(x >> i) & 1] += 1 if cnt[1] > cnt[...
def lmap(f, it): return list(map(f, it)) def ints(it): return lmap(int, it) def solve(input): l = len(input.split()[0]) xs = lmap(lambda x: int(x, 2), input.split()) a = 0 for i in range(l): cnt = [0, 0] for x in xs: cnt[x >> i & 1] += 1 if cnt[1] > cnt[0]: ...
#!/usr/bin/env python3 # # Author: # Tamas Jos (@skelsec) # PROCESS_QUERY_INFORMATION = 0x0400 PROCESS_VM_READ = 0x0010 PROCESS_VM_WRITE = 0x0020 PROCESS_VM_OPERATION = 0x0008 PROCESS_CREATE_THREAD = 0x0002 # Standard access rights DELETE = 0x00010000 READ_CONTROL = 0x00...
process_query_information = 1024 process_vm_read = 16 process_vm_write = 32 process_vm_operation = 8 process_create_thread = 2 delete = 65536 read_control = 131072 write_dac = 262144 write_owner = 524288 synchronize = 1048576 standard_rights_required = 983040 standard_rights_read = READ_CONTROL standard_rights_write = ...
class Helper: @staticmethod def is_Empty(obj): flag = False if obj is None: flag = True elif not obj.strip(): flag = True else: flag = False return flag if __name__ == '__main__': print(Helper.is_Empty(None))
class Helper: @staticmethod def is__empty(obj): flag = False if obj is None: flag = True elif not obj.strip(): flag = True else: flag = False return flag if __name__ == '__main__': print(Helper.is_Empty(None))
''' Lambda expressions are quick way of creating the anonymous functions: ''' #function without lamda expression: def square(num): return num ** 2 print(square(5)) #converting it into lambda expression: lambda num : num ** 2 #if we want we can assign this to variable like square2 = lambda num : num ** 2. # we are...
""" Lambda expressions are quick way of creating the anonymous functions: """ def square(num): return num ** 2 print(square(5)) lambda num: num ** 2 square2 = lambda num: num ** 2.0 print(square2(5)) print(list(map(lambda num: num ** 2, [1, 2, 3, 4]))) '\nMap: map() --> map(func, *iterables) --> map object\n' def...
# Builds the Netty fork of Tomcat Native. See http://netty.io/wiki/forked-tomcat-native.html { 'targets': [ { 'target_name': 'netty-tcnative-so', 'product_name': 'netty-tcnative', 'type': 'shared_library', 'sources': [ 'src/c/address.c', 'src/c/bb.c', 'src/c/dir.c',...
{'targets': [{'target_name': 'netty-tcnative-so', 'product_name': 'netty-tcnative', 'type': 'shared_library', 'sources': ['src/c/address.c', 'src/c/bb.c', 'src/c/dir.c', 'src/c/error.c', 'src/c/file.c', 'src/c/info.c', 'src/c/jnilib.c', 'src/c/lock.c', 'src/c/misc.c', 'src/c/mmap.c', 'src/c/multicast.c', 'src/c/network...
# https://www.acmicpc.net/problem/9020 if __name__ == '__main__': input = __import__('sys').stdin.readline N = 10_001 T = int(input()) is_prime = [True for _ in range(N)] sqrt = int(N ** (1 / 2)) is_prime[0] = is_prime[1] = False for idx in range(2, sqrt + 1): if not is_prime[idx]...
if __name__ == '__main__': input = __import__('sys').stdin.readline n = 10001 t = int(input()) is_prime = [True for _ in range(N)] sqrt = int(N ** (1 / 2)) is_prime[0] = is_prime[1] = False for idx in range(2, sqrt + 1): if not is_prime[idx]: continue for num in r...
def bin_value(num): return bin(num) [2:] def remove0b(num): return num [2:] numberA = int(input("")) numberB = int(input("")) binaryA = bin_value(numberA) binaryB = bin_value(numberB) sum = bin(int(binaryA,2) + int(binaryB,2)) cleaned = remove0b(sum) binaryA = str(binaryA) binaryB = str(binaryB) sum = str(cle...
def bin_value(num): return bin(num)[2:] def remove0b(num): return num[2:] number_a = int(input('')) number_b = int(input('')) binary_a = bin_value(numberA) binary_b = bin_value(numberB) sum = bin(int(binaryA, 2) + int(binaryB, 2)) cleaned = remove0b(sum) binary_a = str(binaryA) binary_b = str(binaryB) sum = st...
#!/usr/bin/env python # encoding: utf-8 ''' @author: Jason Lee @license: (C) Copyright @ Jason Lee @contact: jiansenll@163.com @file: jianzhi_offer_31.py @time: 2019/4/23 16:09 @desc: ''' class Solution: def FindGreatestSumOfSubArray(self, array): if not array: return 0 f = arr...
""" @author: Jason Lee @license: (C) Copyright @ Jason Lee @contact: jiansenll@163.com @file: jianzhi_offer_31.py @time: 2019/4/23 16:09 @desc: """ class Solution: def find_greatest_sum_of_sub_array(self, array): if not array: return 0 f = array for i in range(1, len(arr...
k, n, w = map(int, input().split()) x = 1 money = 0 while x <= w and money != -1: money += k * x x += 1 money_toborrow = money - n if money_toborrow >= 0: print(money_toborrow) else: print(0)
(k, n, w) = map(int, input().split()) x = 1 money = 0 while x <= w and money != -1: money += k * x x += 1 money_toborrow = money - n if money_toborrow >= 0: print(money_toborrow) else: print(0)
def fatorial (n): r = 1 for num in range (n, 1, -1): r *= num return r def dobro (n): num = n * 2 return num def triplo (n): num = n * 3 return num
def fatorial(n): r = 1 for num in range(n, 1, -1): r *= num return r def dobro(n): num = n * 2 return num def triplo(n): num = n * 3 return num
#####################################Data class class RealNews(object): def __init__(self, date, headline, description,distype, url="", imageurl="",location=""): self.date = date self.headline = headline self.description = description self.url = url self.distype = distype ...
class Realnews(object): def __init__(self, date, headline, description, distype, url='', imageurl='', location=''): self.date = date self.headline = headline self.description = description self.url = url self.distype = distype self.imageurl = imageurl self.lo...
bicicleta=["bike","cannon","cargo", "CALOI"] #Armazenamento de farias mensagens/lista em uma string print(bicicleta[0].title()) print(bicicleta[1]) print(bicicleta[2]) print(bicicleta[3]) print(bicicleta[-1]) print(bicicleta[-2]) print(bicicleta[-3]) print(bicicleta[-4].title()) #como...
bicicleta = ['bike', 'cannon', 'cargo', 'CALOI'] print(bicicleta[0].title()) print(bicicleta[1]) print(bicicleta[2]) print(bicicleta[3]) print(bicicleta[-1]) print(bicicleta[-2]) print(bicicleta[-3]) print(bicicleta[-4].title()) mensagem = 'Minha Primeira Bicicleta foi uma ' + bicicleta[3].title() + '!' print(mensagem)
class Subtract: def __init__(self,fnum,snum): self.fnum=fnum self.snum=snum def allSub(self): self.sub=self.fnum-self.snum return self.sub
class Subtract: def __init__(self, fnum, snum): self.fnum = fnum self.snum = snum def all_sub(self): self.sub = self.fnum - self.snum return self.sub
model = Sequential() model.add(LSTM(50, return_sequences = True, input_shape = (x_train.shape[1], 1))) model.add(LSTM(50, return_sequences = False)) model.add(Dense(25)) model.add(Dense(1)) #Compiling the model model.compile(optimizer = 'adam', loss = 'mean_squared_error') #using rmse
model = sequential() model.add(lstm(50, return_sequences=True, input_shape=(x_train.shape[1], 1))) model.add(lstm(50, return_sequences=False)) model.add(dense(25)) model.add(dense(1)) model.compile(optimizer='adam', loss='mean_squared_error')
DEFAULT_REDIS_PORT = 6379 # Number of seconds to sleep upon successful end to allow graceful termination of subprocesses. TERMINATION_TIME = 3 # Max caps on parameters MAX_NUM_STEPS = 10000 MAX_OBSERVATION_DELTA = 5000 MAX_VIDEO_FPS = 60
default_redis_port = 6379 termination_time = 3 max_num_steps = 10000 max_observation_delta = 5000 max_video_fps = 60
key = input().strip() value = input().strip() count = int(input()) result = '' for entry in range(count): keys, values = input().split(' => ') if key in keys: result += f'{keys}:\n' if value in values: all_values = '\n'.join([f'-{v}' for v in values.split(';') if value in v]) ...
key = input().strip() value = input().strip() count = int(input()) result = '' for entry in range(count): (keys, values) = input().split(' => ') if key in keys: result += f'{keys}:\n' if value in values: all_values = '\n'.join([f'-{v}' for v in values.split(';') if value in v]) ...
''' Author : MiKueen Level : Medium Problem Statement : Product of Array Except Self Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Example: Input: [1,2,3,4] Output: [24,12,8,6] Constraint: It's guaranteed...
""" Author : MiKueen Level : Medium Problem Statement : Product of Array Except Self Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Example: Input: [1,2,3,4] Output: [24,12,8,6] Constraint: It's guaranteed...
name = str(input()) salary = float(input()) sales = float(input()) total = salary + (sales * 0.15) print(f'TOTAL = R$ {total:.2f}')
name = str(input()) salary = float(input()) sales = float(input()) total = salary + sales * 0.15 print(f'TOTAL = R$ {total:.2f}')
class Parameters: WINDOW_WIDTH = 500 WINDOW_HEIGHT = 600 BASE_HEIGHT = 100 BASE_IMAGE = "base.png" BACKGROUND_IMAGE = "bg.png" BIRD_IMAGES = ["bird1.png", "bird2.png", "bird3.png"] PIPE_IMAGES = ["pipe.png"]
class Parameters: window_width = 500 window_height = 600 base_height = 100 base_image = 'base.png' background_image = 'bg.png' bird_images = ['bird1.png', 'bird2.png', 'bird3.png'] pipe_images = ['pipe.png']
d=dict() for _ in range(int(input())): s=input().split(' ',1) d[s[0]]=list(map(int,s[1].split())) d=dict(sorted(d.items(), key=lambda x: x[0])) d=dict(sorted(d.items(), key=lambda x: x[1][2],reverse=True)) d=dict(sorted(d.items(), key=lambda x: x[1][1],reverse=True)) d=dict(sorted(d.items(), key=lambda x: x[1][...
d = dict() for _ in range(int(input())): s = input().split(' ', 1) d[s[0]] = list(map(int, s[1].split())) d = dict(sorted(d.items(), key=lambda x: x[0])) d = dict(sorted(d.items(), key=lambda x: x[1][2], reverse=True)) d = dict(sorted(d.items(), key=lambda x: x[1][1], reverse=True)) d = dict(sorted(d.items(), k...
def my_func(count=4): for i in range (1, 5): print("count", count) if count == 2: print("count", count) count = count - 1 my_func()
def my_func(count=4): for i in range(1, 5): print('count', count) if count == 2: print('count', count) count = count - 1 my_func()
s = str(input()) ss = ''.join(list(reversed(s))) sss = ss[:2] ssss = ''.join(list(reversed(sss))) print(ssss)
s = str(input()) ss = ''.join(list(reversed(s))) sss = ss[:2] ssss = ''.join(list(reversed(sss))) print(ssss)
num=5 for i in range(1,num+1): toPrint="" end=int(i*(i+1)/2) a=list(j for j in range(end+1-i,end+1)) for x in a: toPrint+=" "+str(x) print(toPrint) toPrint="" #output ''' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 '''
num = 5 for i in range(1, num + 1): to_print = '' end = int(i * (i + 1) / 2) a = list((j for j in range(end + 1 - i, end + 1))) for x in a: to_print += ' ' + str(x) print(toPrint) to_print = '' '\n1\n2 3\n4 5 6\n7 8 9 10\n11 12 13 14 15\n'
expected_output = { 'mstp': { 'mst_instances': { 0: { 'mst_id': 0, 'bridge_priority': 32768, 'bridge_sysid': 0, 'bridge_address': '00e3.04ff.ad03', 'topology_change_flag': False, 'topology_detected_...
expected_output = {'mstp': {'mst_instances': {0: {'mst_id': 0, 'bridge_priority': 32768, 'bridge_sysid': 0, 'bridge_address': '00e3.04ff.ad03', 'topology_change_flag': False, 'topology_detected_flag': False, 'topology_changes': 0, 'time_since_topology_change': '142:22:13', 'times': {'hold': 1, 'topology_change': 70, 'n...
#THIS IS HANGMAN print('"Hangman"\nA game where you will try to guess which the hidden word is!') print('\n') word = input('Input the word to guess:\n') while True: if word.isalpha(): break else: word = input('Wrong input, type a valid word:\n') number_of_letters = len(word) word_listed_lett...
print('"Hangman"\nA game where you will try to guess which the hidden word is!') print('\n') word = input('Input the word to guess:\n') while True: if word.isalpha(): break else: word = input('Wrong input, type a valid word:\n') number_of_letters = len(word) word_listed_letters = list(word) prin...
dataset_type = "SuperviselyDataset" data_root = '/data/slyproject' class_names = ['Car', 'Pedestrian', 'Cyclist', 'DontCare'] point_cloud_range = [0, -40, -3, 70.4, 40, 1] input_modality = dict(use_lidar=True, use_camera=False) file_client_args = dict(backend='disk') # db_sampler = dict( # data_root=data_root, # ...
dataset_type = 'SuperviselyDataset' data_root = '/data/slyproject' class_names = ['Car', 'Pedestrian', 'Cyclist', 'DontCare'] point_cloud_range = [0, -40, -3, 70.4, 40, 1] input_modality = dict(use_lidar=True, use_camera=False) file_client_args = dict(backend='disk') train_pipeline = [dict(type='LoadPointsFromSlyFile')...
while True: num = int(input("Enter a number: ")) if num % 2 == 0: print(num, "is an even number") else: print(f"{num} is a odd number")
while True: num = int(input('Enter a number: ')) if num % 2 == 0: print(num, 'is an even number') else: print(f'{num} is a odd number')
__package_name__ = 'python-utils' __version__ = '2.5.0' __author__ = 'Rick van Hattem' __author_email__ = 'Wolph@wol.ph' __description__ = ( 'Python Utils is a module with some convenient utilities not included ' 'with the standard Python install') __url__ = 'https://github.com/WoLpH/python-utils'
__package_name__ = 'python-utils' __version__ = '2.5.0' __author__ = 'Rick van Hattem' __author_email__ = 'Wolph@wol.ph' __description__ = 'Python Utils is a module with some convenient utilities not included with the standard Python install' __url__ = 'https://github.com/WoLpH/python-utils'
class BBUtil(object): def __init__(self,width,height): super(BBUtil, self).__init__() self.width=width self.height=height def xywh_to_tlwh(self, bbox_xywh): x,y,w,h = bbox_xywh xmin = max(int(round(x - (w / 2))),0) ymin = max(int(round(y - (h / 2))),0) r...
class Bbutil(object): def __init__(self, width, height): super(BBUtil, self).__init__() self.width = width self.height = height def xywh_to_tlwh(self, bbox_xywh): (x, y, w, h) = bbox_xywh xmin = max(int(round(x - w / 2)), 0) ymin = max(int(round(y - h / 2)), 0) ...
class Storage: __storage = 0 def __init__(self, capacity): self.capacity = capacity self.storage = [] def add_product(self, product): if not Storage.__storage == self.capacity: self.storage.append(product) Storage.__storage += 1 def get_products(self): ...
class Storage: __storage = 0 def __init__(self, capacity): self.capacity = capacity self.storage = [] def add_product(self, product): if not Storage.__storage == self.capacity: self.storage.append(product) Storage.__storage += 1 def get_products(self): ...
def signFinder (s): plus = s.count("-") minus = s.count("+") total = plus+minus if total == 1: return True else: return False
def sign_finder(s): plus = s.count('-') minus = s.count('+') total = plus + minus if total == 1: return True else: return False
def binary_search(arr, target): low, high = 0, len(arr)-1 while low < high: mid = (low + high)/2 if arr[mid] == target: return mid elif arr[mid] > target: high = mid - 1 else: low = mid + 1 return high if __name__ == "__main__": lst = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ...
def binary_search(arr, target): (low, high) = (0, len(arr) - 1) while low < high: mid = (low + high) / 2 if arr[mid] == target: return mid elif arr[mid] > target: high = mid - 1 else: low = mid + 1 return high if __name__ == '__main__': ...
#EP1 ''' def getPentagonalNumber(n): i = 1 for i in range(1,n+1): s = (i*(3*i-1)*1.0)/2 print (str(s)+' ',end='') if i%10==0: print() getPentagonalNumber(100) ''' #EP2 ''' def sum(n): s= 0 while(n%10!=0): a=n%10 b=n//10 s=s+a n=b p...
""" def getPentagonalNumber(n): i = 1 for i in range(1,n+1): s = (i*(3*i-1)*1.0)/2 print (str(s)+' ',end='') if i%10==0: print() getPentagonalNumber(100) """ '\ndef sum(n):\n s= 0\n while(n%10!=0):\n a=n%10\n b=n//10\n s=s+a\n n=b\n print...
# coding=utf-8 __author__ = 'co2y' __email__ = 'co2y@foxmail.com' __version__ = '0.0.1'
__author__ = 'co2y' __email__ = 'co2y@foxmail.com' __version__ = '0.0.1'
def main(): full_name = get_full_name() print() password = get_password() print() first_name = get_first_name(full_name) print("Hi " + first_name + ", thanks for creating an account.") def get_full_name(): while True: name = input("Enter full name: ").s...
def main(): full_name = get_full_name() print() password = get_password() print() first_name = get_first_name(full_name) print('Hi ' + first_name + ', thanks for creating an account.') def get_full_name(): while True: name = input('Enter full name: ').strip() if ' ' in...
#EVALUATION OF THE MODEL def evaluate_model(model, X_test, y_test): _, score = model.evaluate(X_test, y_test, verbose = 0) print(score) def predict_model(model, X): y = model.predict(X) print(y) def predict_class_model(model, X): y = model.predict_classes(X) print(y)
def evaluate_model(model, X_test, y_test): (_, score) = model.evaluate(X_test, y_test, verbose=0) print(score) def predict_model(model, X): y = model.predict(X) print(y) def predict_class_model(model, X): y = model.predict_classes(X) print(y)
class Solution: def removeKdigits(self, num: str, k: int) -> str: if len(num) == 0 and len(num) <= k : return "0" st = [num[0]] i = 1 while i < len(num): while len(st) > 0 and int(st[-1]) > int(num[i]) and k > 0: st.pop() ...
class Solution: def remove_kdigits(self, num: str, k: int) -> str: if len(num) == 0 and len(num) <= k: return '0' st = [num[0]] i = 1 while i < len(num): while len(st) > 0 and int(st[-1]) > int(num[i]) and (k > 0): st.pop() k -...
file_input = open("motivation.txt",'w') file_input.write("Never give up") file_input.write("\nRise above hate") file_input.write("\nNo body remember second place") file_input.close()
file_input = open('motivation.txt', 'w') file_input.write('Never give up') file_input.write('\nRise above hate') file_input.write('\nNo body remember second place') file_input.close()
__title__ = "django-kindeditor" __description__ = "Django admin KindEditor integration." __url__ = "https://github.com/waketzheng/django-kindeditor" __version__ = "0.3.0" __author__ = "Waket Zheng" __author_email__ = "waketzheng@gmail.com" __license__ = "MIT" __copyright__ = "Copyright 2019 Waket Zheng"
__title__ = 'django-kindeditor' __description__ = 'Django admin KindEditor integration.' __url__ = 'https://github.com/waketzheng/django-kindeditor' __version__ = '0.3.0' __author__ = 'Waket Zheng' __author_email__ = 'waketzheng@gmail.com' __license__ = 'MIT' __copyright__ = 'Copyright 2019 Waket Zheng'