content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'leidong.liu' __version__ = '0.1.11.13' __email__ = 'leidong.liu@gmail.com'
__author__ = 'leidong.liu' __version__ = '0.1.11.13' __email__ = 'leidong.liu@gmail.com'
# Python program to count the number occurrence of a specific character in a string String = input("Enter a string: ") Alphabet = input("Enter the alphabet to find: ") count = 0 for i in String: if i == Alphabet: count += 1 print(f'{Alphabet} coccured {count} times in {String}')
string = input('Enter a string: ') alphabet = input('Enter the alphabet to find: ') count = 0 for i in String: if i == Alphabet: count += 1 print(f'{Alphabet} coccured {count} times in {String}')
class Error(Exception): pass class TargetPairError(Error): def __init__(self, target_pair): self.target_pair = target_pair def __str__(self): return f"ERROR: '{self.target_pair}' not a valid target pair or format" class ParameterRequiredError(Error): def __init__(self, params): ...
class Error(Exception): pass class Targetpairerror(Error): def __init__(self, target_pair): self.target_pair = target_pair def __str__(self): return f"ERROR: '{self.target_pair}' not a valid target pair or format" class Parameterrequirederror(Error): def __init__(self, params): ...
expected_output = { 'vrf': {'default': {'address_family': {'ipv4 label unicast': {'bgp_table_version': 28, 'local_router_id': '10.186.101.1', 'prefixes': {'10.4.1.0/24': ...
expected_output = {'vrf': {'default': {'address_family': {'ipv4 label unicast': {'bgp_table_version': 28, 'local_router_id': '10.186.101.1', 'prefixes': {'10.4.1.0/24': {'index': {1: {'next_hop': '0.0.0.0', 'localprf': 100, 'origin_codes': 'i', 'path_type': 'l', 'status_codes': '*>', 'weight': 32768}}}, '10.16.1.0/24':...
# ====================================== # URLS Component # ====================================== API_VERSION = "v1" BASE_URL = f"https://api.bestbuy.com/{API_VERSION}/" # ====================================== # API Names # ====================================== PRODUCT_API = "products" CATE...
api_version = 'v1' base_url = f'https://api.bestbuy.com/{API_VERSION}/' product_api = 'products' category_api = 'categories' bulk_api = 'bulk' stores_api = 'stores' product_description_types = {1: 'name', 2: 'description', 3: 'shortDescription', 4: 'longDescription'} product_search_criteria_types = {1: 'customerReviewA...
lst = [] for i in range(2000,3001): x=i value1 = x%10 x= (x-value1)//10 value2 = x%10 x= (x-value2)//10 value3 = x%10 x= (x-value3)//10 if(value1%2==0 and value2%2==0 and value3%2==0 and x%2==0): lst.append(i) print(lst)
lst = [] for i in range(2000, 3001): x = i value1 = x % 10 x = (x - value1) // 10 value2 = x % 10 x = (x - value2) // 10 value3 = x % 10 x = (x - value3) // 10 if value1 % 2 == 0 and value2 % 2 == 0 and (value3 % 2 == 0) and (x % 2 == 0): lst.append(i) print(lst)
class DfsRecursive: def __init__(self, g): self.g = g self.n = g.vertex_count() self.visited = {node: False for node in g.vertices()} def dfs(self, v): self.visited[v] = True neighbors = [x for x in self.g._outgoing[v].keys()] for neighbor in neighbors: ...
class Dfsrecursive: def __init__(self, g): self.g = g self.n = g.vertex_count() self.visited = {node: False for node in g.vertices()} def dfs(self, v): self.visited[v] = True neighbors = [x for x in self.g._outgoing[v].keys()] for neighbor in neighbors: ...
class Compression: def __init__(self): pass def encode(self, bytes): return bytes def decode(self, bytes): return bytes
class Compression: def __init__(self): pass def encode(self, bytes): return bytes def decode(self, bytes): return bytes
# Problem: https://dashboard.programmingpathshala.com/practice/question?questionId=29&sectionId=1&moduleId=1&topicId=2&subtopicId=19&assignmentId=4 q = int(input()) ans = [] for i in range(q): n, a, b, k = map(int, input().split()) min_m = min(a,b) max_m = max(a,b) if min_m > 0: while (max_m % ...
q = int(input()) ans = [] for i in range(q): (n, a, b, k) = map(int, input().split()) min_m = min(a, b) max_m = max(a, b) if min_m > 0: while max_m % min_m != 0: tmp = max_m % min_m max_m = min_m min_m = tmp gcd = min_m else: gcd = max_m ...
{ 'variables': { 'target_arch%': '<!(node preinstall.js --print-arch)>' }, 'targets': [ { 'target_name': 'sodium', 'include_dirs' : [ "<!(node -e \"require('nan')\")", 'libsodium/src/libsodium/include' ], 'sources': [ 'binding.cc', 'src/crypto_hash_s...
{'variables': {'target_arch%': '<!(node preinstall.js --print-arch)>'}, 'targets': [{'target_name': 'sodium', 'include_dirs': ['<!(node -e "require(\'nan\')")', 'libsodium/src/libsodium/include'], 'sources': ['binding.cc', 'src/crypto_hash_sha256_wrap.cc', 'src/crypto_hash_sha512_wrap.cc', 'src/crypto_generichash_wrap....
class Person: def __init__(self, canvas_dict): self.__dict__.update(canvas_dict) self.submissions = [] def __repr__(self): return self.name + ' (' + self.canvas_id + ')' @classmethod def table_headings(cls): return ['Name', 'Canvas ID', 'SIS ID', 'RegCreated', 'RegUpd...
class Person: def __init__(self, canvas_dict): self.__dict__.update(canvas_dict) self.submissions = [] def __repr__(self): return self.name + ' (' + self.canvas_id + ')' @classmethod def table_headings(cls): return ['Name', 'Canvas ID', 'SIS ID', 'RegCreated', 'RegUpda...
# !/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ingbyr" def s2b(str): if isinstance(str, bool): return str if str == 'false': return False elif str == 'true': return True else: return None
__author__ = 'ingbyr' def s2b(str): if isinstance(str, bool): return str if str == 'false': return False elif str == 'true': return True else: return None
vowels = ['a', 'e', 'i', 'o', 'u'] words = [ 'milliways', 'hitch_hiker', 'galaxy', 'sky', ] print(words) found = [] for word in words: for letter in word: if letter in vowels: if letter not in found: found.append(letter) for vowel in found: print(vowel)
vowels = ['a', 'e', 'i', 'o', 'u'] words = ['milliways', 'hitch_hiker', 'galaxy', 'sky'] print(words) found = [] for word in words: for letter in word: if letter in vowels: if letter not in found: found.append(letter) for vowel in found: print(vowel)
PUT_SLAVE_DEVICES = { "type": "array", "items": { "type": "object" } } POST_SLAVE_DEVICES = { "type": "object", "properties": { "scheme": { "enum": ["http", "https"] }, "host": { "type": "string", "maxLength": 256 }, ...
put_slave_devices = {'type': 'array', 'items': {'type': 'object'}} post_slave_devices = {'type': 'object', 'properties': {'scheme': {'enum': ['http', 'https']}, 'host': {'type': 'string', 'maxLength': 256}, 'port': {'type': 'integer', 'min': 0, 'max': 65535}, 'path': {'type': 'string', 'maxLength': 256}, 'admin_passwor...
CAPTION_ABOVE = 0 CAPTION_BELOW = 1 class Message(): def __init__(self, message: str = None, image: str = None, image_url: str = None, message_media_relation: int = CAPTION_ABOVE, buttons: list = None, meta: str ...
caption_above = 0 caption_below = 1 class Message: def __init__(self, message: str=None, image: str=None, image_url: str=None, message_media_relation: int=CAPTION_ABOVE, buttons: list=None, meta: str=''): self.message = message self.image = image self.image_url = image_url self.mes...
# # PySNMP MIB module CISCO-HSRP-EXT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-HSRP-EXT-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:59:49 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, ...
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, single_value_constraint, constraints_intersection, value_size_constraint, constraints_union) ...
''' Author: jianzhnie Date: 2021-12-01 14:25:47 LastEditTime: 2021-12-01 17:29:14 LastEditors: jianzhnie Description: '''
""" Author: jianzhnie Date: 2021-12-01 14:25:47 LastEditTime: 2021-12-01 17:29:14 LastEditors: jianzhnie Description: """
def dosubtraction(a,b): sub=a-b #subtraction of 2 numbers print(sub) a=15 b=5 dosubtraction(a,b)
def dosubtraction(a, b): sub = a - b print(sub) a = 15 b = 5 dosubtraction(a, b)
################################################################################ # Function arguments ################################################################################ def func(*args, **kwargs): return args, kwargs args = (1, 2) kwargs = { 'x': 3, 'y': 4 } assert func(*args, **kwargs) == func(1, 2...
def func(*args, **kwargs): return (args, kwargs) args = (1, 2) kwargs = {'x': 3, 'y': 4} assert func(*args, **kwargs) == func(1, 2, x=3, y=4) def keywords_only(size, *, block=True): pass keywords_only(8192, block=True) def make_adder(x, y): def add(): return x + y return add adder = make_adde...
# # PySNMP MIB module ALCATEL-IND1-ERP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-ERP-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:17:32 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (defau...
(softent_ind1_erp,) = mibBuilder.importSymbols('ALCATEL-IND1-BASE', 'softentIND1Erp') (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Code Constants skip = 'skip' sorting_type_delta_count = 'delta_count' sorting_type_delta_percent = 'delta_percent' # Reserved column names group_column_name = "group" other_feature_cluster_name = 'other' control_group = 'control' treatment_grou...
skip = 'skip' sorting_type_delta_count = 'delta_count' sorting_type_delta_percent = 'delta_percent' group_column_name = 'group' other_feature_cluster_name = 'other' control_group = 'control' treatment_group = 'treatment' feature = 'feature' resample = 'resample' expected_failures = '# of Expected Failures in Treatment'...
n = int(input("Enter side of rhombus: ")) for i in range(n): print(' '*i + '* '*n)
n = int(input('Enter side of rhombus: ')) for i in range(n): print(' ' * i + '* ' * n)
class EntityType: BLOCK = 'block' TRANSACTION = 'transaction' LOG = 'log' MESSAGE = 'message' BLOCK_EVENT = 'block_event' ORACLE_REQUEST = 'oracle_request' ALL_FOR_STREAMING = [BLOCK, TRANSACTION, LOG, MESSAGE, BLOCK_EVENT, ORACLE_REQUEST]
class Entitytype: block = 'block' transaction = 'transaction' log = 'log' message = 'message' block_event = 'block_event' oracle_request = 'oracle_request' all_for_streaming = [BLOCK, TRANSACTION, LOG, MESSAGE, BLOCK_EVENT, ORACLE_REQUEST]
with open("../docs/html/index.qhp", "r+") as qhp: lines = qhp.readlines() lines.insert(-3, "<file>m-light+documentation.compiled.css</file>") qhp.seek(0) qhp.truncate() qhp.writelines(lines)
with open('../docs/html/index.qhp', 'r+') as qhp: lines = qhp.readlines() lines.insert(-3, '<file>m-light+documentation.compiled.css</file>') qhp.seek(0) qhp.truncate() qhp.writelines(lines)
# # PySNMP MIB module HPN-ICF-EVI-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-EVI-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:38:45 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27...
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_intersection, constraints_union, value_range_constraint, value_size_constraint) ...
def f(*a, x): pass def f(*a, x = 1): pass def f(a: 1): pass def f(*a: 1): pass def f(**a: 1): pass def f(a: 0, *b: 1, **c: 2): pass def f() -> 1: pass def f(a: 1) -> 1: pass def f(a: 1 = 2): pass def f(*, a): pass
def f(*a, x): pass def f(*a, x=1): pass def f(a: 1): pass def f(*a: 1): pass def f(**a: 1): pass def f(a: 0, *b: 1, **c: 2): pass def f() -> 1: pass def f(a: 1) -> 1: pass def f(a: 1=2): pass def f(*, a): pass
'''Estimate Pi''' raise Exception("FAIL ON PURPOSE") def nth_term(n): return 4 / (2.0 * n + 1) * (-1) ** n def approximate_pi(error): prev = nth_term(0) # First term current = nth_term(0) + nth_term(1) # 1st + 2nd n = 2 # Starts at third term while abs(prev - current) > error: prev = c...
"""Estimate Pi""" raise exception('FAIL ON PURPOSE') def nth_term(n): return 4 / (2.0 * n + 1) * (-1) ** n def approximate_pi(error): prev = nth_term(0) current = nth_term(0) + nth_term(1) n = 2 while abs(prev - current) > error: prev = current current += nth_term(n) n += 1...
# Python - 2.7.6 test.describe('Basic Tests') test.it('Not too sexy!') test.assert_equals(sexy_name('GUV'), 'NOT TOO SEXY') test.assert_equals(sexy_name('PHUG'), 'NOT TOO SEXY') test.assert_equals(sexy_name('FFFFF'), 'NOT TOO SEXY') test.assert_equals(sexy_name(''), 'NOT TOO SEXY') test.assert_equals(sexy_name('PHUG'...
test.describe('Basic Tests') test.it('Not too sexy!') test.assert_equals(sexy_name('GUV'), 'NOT TOO SEXY') test.assert_equals(sexy_name('PHUG'), 'NOT TOO SEXY') test.assert_equals(sexy_name('FFFFF'), 'NOT TOO SEXY') test.assert_equals(sexy_name(''), 'NOT TOO SEXY') test.assert_equals(sexy_name('PHUG'), 'NOT TOO SEXY') ...
''' Script for extracting only the specified columns in the specified order in a CONLL like text file. ''' CONLL_U_FILE = r'''C:\..twitter_1.conllu''' OUTPUT_FILE = r'''C:\..\twitter_1.conllu''' columns_to_keep_and_order = [1,3,7,10] # add pseudo tag for abbreviation detection add_Others_Answer = False f = open(CON...
""" Script for extracting only the specified columns in the specified order in a CONLL like text file. """ conll_u_file = 'C:\\..twitter_1.conllu' output_file = 'C:\\..\\twitter_1.conllu' columns_to_keep_and_order = [1, 3, 7, 10] add__others__answer = False f = open(CONLL_U_FILE, 'r') fw = open(OUTPUT_FILE, 'w') for l...
# 350111 # a3 p10.py # Priyanka Sharma # pr.sharma@jacobs-university.de n=int(input("Enter width:")) m=int(input("Enter a height:")) c=input("Enter a character:") def print_rectagle(n,m,ch): for i in range(m): for j in range(n): if i == 0 or i == m-1: print (ch, end = '') ...
n = int(input('Enter width:')) m = int(input('Enter a height:')) c = input('Enter a character:') def print_rectagle(n, m, ch): for i in range(m): for j in range(n): if i == 0 or i == m - 1: print(ch, end='') elif j == 0 or j == n - 1: print(ch, end=''...
''' OnionPerf Authored by Rob Jansen, 2015 Copyright 2015-2020 The Tor Project See LICENSE for licensing information ''' __all__ = [ 'analysis', 'measurement', 'model', 'monitor', 'util', 'visualization', ]
""" OnionPerf Authored by Rob Jansen, 2015 Copyright 2015-2020 The Tor Project See LICENSE for licensing information """ __all__ = ['analysis', 'measurement', 'model', 'monitor', 'util', 'visualization']
def LineCrossing(midpoint,p_midpoint,line0,line1): A = midpoint B = p_midpoint C = line0 D = line1 ccw1 = (D[1] - A[1]) * (C[0] - A[0]) > (C[1] - A[1]) * (D[0] - A[0]) ccw2 = (D[1] - B[1]) * (C[0] - B[0]) > (C[1] - B[1]) * (D[0] - B[0]) ccw3 = (C[1] - A[1]) * (B[0] - A[0]) > (B[1] - A[1]) * (C[0] - A[0]) ...
def line_crossing(midpoint, p_midpoint, line0, line1): a = midpoint b = p_midpoint c = line0 d = line1 ccw1 = (D[1] - A[1]) * (C[0] - A[0]) > (C[1] - A[1]) * (D[0] - A[0]) ccw2 = (D[1] - B[1]) * (C[0] - B[0]) > (C[1] - B[1]) * (D[0] - B[0]) ccw3 = (C[1] - A[1]) * (B[0] - A[0]) > (B[1] - A[1]...
day_of_the_week = int(input()) if day_of_the_week == 1: print("Monday") elif day_of_the_week == 2: print("Tuesday") elif day_of_the_week == 3: print("Wednesday") elif day_of_the_week == 4: print("Thursday") elif day_of_the_week == 5: print("Friday") elif day_of_the_week == 6: print("Saturday") ...
day_of_the_week = int(input()) if day_of_the_week == 1: print('Monday') elif day_of_the_week == 2: print('Tuesday') elif day_of_the_week == 3: print('Wednesday') elif day_of_the_week == 4: print('Thursday') elif day_of_the_week == 5: print('Friday') elif day_of_the_week == 6: print('Saturday') e...
class ConfigKeys: AMQPUri = "AMQP_URI" DBUri = "DB_URI" class RPCMicroServices: UserService = "user_service" FeedService = "feed_service"
class Configkeys: amqp_uri = 'AMQP_URI' db_uri = 'DB_URI' class Rpcmicroservices: user_service = 'user_service' feed_service = 'feed_service'
m = 120 #kg g = 9.8 #m/s M = 5 #kg L = 0.48 #m V1 = m*g/2 V2 = m*g/4 V3 = m*g/4 w = M*g/L By = (w*L**2 + V2*0.18 + V3*L)/L Ay = V1+V2+V3*w*L-By print(Ay,By)
m = 120 g = 9.8 m = 5 l = 0.48 v1 = m * g / 2 v2 = m * g / 4 v3 = m * g / 4 w = M * g / L by = (w * L ** 2 + V2 * 0.18 + V3 * L) / L ay = V1 + V2 + V3 * w * L - By print(Ay, By)
# Django number-based field's internal type INTEGER_FIELDS = ['IntegerField', 'PositiveIntegerField'] BIG_INTEGER_FIELDS = ['BigIntegerField', 'PositiveBigIntegerField'] SMALL_INTEGER_FIELDS = ['SmallIntegerField', 'PositiveSmallIntegerField'] FLOAT_FIELDS = ['FloatField'] DECIMAL_FIELDS = ['DecimalField'] PK_FIELDS = ...
integer_fields = ['IntegerField', 'PositiveIntegerField'] big_integer_fields = ['BigIntegerField', 'PositiveBigIntegerField'] small_integer_fields = ['SmallIntegerField', 'PositiveSmallIntegerField'] float_fields = ['FloatField'] decimal_fields = ['DecimalField'] pk_fields = ['AutoField', 'BigAutoField', 'SmallAutoFiel...
def quote(text: str, char: str = '"'): return char + text.replace("\\", "\\\\").replace(char, "\\" + char) + char def try_format(src, **kwargs): rep = {} for k, v in kwargs.items(): if ("{" + k + "}") in src: rep[k] = v return src.format(**rep)
def quote(text: str, char: str='"'): return char + text.replace('\\', '\\\\').replace(char, '\\' + char) + char def try_format(src, **kwargs): rep = {} for (k, v) in kwargs.items(): if '{' + k + '}' in src: rep[k] = v return src.format(**rep)
s = input() ans = len(s) cro = ["c=", "c-", "d-", "lj", "nj", "s=", "z=", "dz="] for c in cro: ans -= s.count(c) print(ans)
s = input() ans = len(s) cro = ['c=', 'c-', 'd-', 'lj', 'nj', 's=', 'z=', 'dz='] for c in cro: ans -= s.count(c) print(ans)
class SingletonInstance(object): def __new__(cls, *args, **kwargs): if not hasattr(cls, '_inst'): cls._inst = super(SingletonInstance, cls).__new__(cls) else: def init_pass(self, *args, **kwargs): pass cls.__init__ = init_pass return cls._...
class Singletoninstance(object): def __new__(cls, *args, **kwargs): if not hasattr(cls, '_inst'): cls._inst = super(SingletonInstance, cls).__new__(cls) else: def init_pass(self, *args, **kwargs): pass cls.__init__ = init_pass return cls....
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved def get_launch_environment(): return "local"
def get_launch_environment(): return 'local'
def hey(string): string = string.strip() response = "" if string is "": response = "Fine. Be that way!" elif string.isupper(): response = "Whoa, chill out!" elif string[-1] == "?": response = "Sure." else: response = "Whatever." return response
def hey(string): string = string.strip() response = '' if string is '': response = 'Fine. Be that way!' elif string.isupper(): response = 'Whoa, chill out!' elif string[-1] == '?': response = 'Sure.' else: response = 'Whatever.' return response
def validate_restrictions(restrictions, amount): if restrictions.hard_minimum is not None and amount < restrictions.hard_minimum: return False, None if restrictions.hard_maximum is not None and restrictions.hard_maximum < amount: return False, None if restrictions.soft_minimum is not Non...
def validate_restrictions(restrictions, amount): if restrictions.hard_minimum is not None and amount < restrictions.hard_minimum: return (False, None) if restrictions.hard_maximum is not None and restrictions.hard_maximum < amount: return (False, None) if restrictions.soft_minimum is not Non...
def gcd(i, j): for n in reversed(range(max(i, j)+1)): if i % n == 0 and j % n == 0: return n def test_gcd(): assert gcd(36, 63) == 9 assert gcd(36, 36) == 36 assert gcd(36, 37) == 1 assert gcd(36, 38) == 2 assert gcd(1, 1) == 1 assert gcd(3, 9) == 3
def gcd(i, j): for n in reversed(range(max(i, j) + 1)): if i % n == 0 and j % n == 0: return n def test_gcd(): assert gcd(36, 63) == 9 assert gcd(36, 36) == 36 assert gcd(36, 37) == 1 assert gcd(36, 38) == 2 assert gcd(1, 1) == 1 assert gcd(3, 9) == 3
def new_trie(*keywords): trie = {} for key in keywords: current = trie for char in key: current = current.setdefault(char, {}) current[0] = True return trie def in_trie(trie, key): if not key: return 0 current = trie for char in key: if ...
def new_trie(*keywords): trie = {} for key in keywords: current = trie for char in key: current = current.setdefault(char, {}) current[0] = True return trie def in_trie(trie, key): if not key: return 0 current = trie for char in key: if char n...
first_num = 2 second_num = 3 def add(x, y): print(x+y) add(first_num, second_num)
first_num = 2 second_num = 3 def add(x, y): print(x + y) add(first_num, second_num)
#practicing basic functions def fibo(n): result = [] a,b = 0,1 while(a < n): result.append(a) a,b = b, a + b return result print(fibo(10)) print(fibo(20)) print(fibo(50)) print(fibo(100))
def fibo(n): result = [] (a, b) = (0, 1) while a < n: result.append(a) (a, b) = (b, a + b) return result print(fibo(10)) print(fibo(20)) print(fibo(50)) print(fibo(100))
def super_size(n): out = [i for i in str(n)] m = int("".join(list(sorted(out))[::-1])) return m print(super_size(2150))
def super_size(n): out = [i for i in str(n)] m = int(''.join(list(sorted(out))[::-1])) return m print(super_size(2150))
## ## this file autogenerated ## 9.1(1)4 ## jmp_esp_offset = "173.250.27.8" saferet_offset = "134.177.3.9" fix_ebp = "72" pmcheck_bounds = "0.112.127.9" pmcheck_offset = "176.119.127.9" pmcheck_code = "85.49.192.137" admauth_bounds = "0.48.8.8" admauth_offset = "96.49.8.8" admauth_code = "85.137.229.87" # "9.1(1)4" ...
jmp_esp_offset = '173.250.27.8' saferet_offset = '134.177.3.9' fix_ebp = '72' pmcheck_bounds = '0.112.127.9' pmcheck_offset = '176.119.127.9' pmcheck_code = '85.49.192.137' admauth_bounds = '0.48.8.8' admauth_offset = '96.49.8.8' admauth_code = '85.137.229.87'
rs = open("cov5.rs.fa","w") gb = open("cov5.gb.fa","w") frag = open("cov5.frag.fa","w") dest = None for line in open('cov5.fa'): if line.startswith('>'): if 'complete genome' in line: if line.startswith(">NC_"): dest=rs else: dest=gb else: ...
rs = open('cov5.rs.fa', 'w') gb = open('cov5.gb.fa', 'w') frag = open('cov5.frag.fa', 'w') dest = None for line in open('cov5.fa'): if line.startswith('>'): if 'complete genome' in line: if line.startswith('>NC_'): dest = rs else: dest = gb els...
# # PySNMP MIB module CISCO-PAE-CAPABILITY (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-PAE-CAPABILITY # Produced by pysmi-0.3.4 at Mon Apr 29 17:52:24 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (defau...
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_size_constraint, value_range_constraint, constraints_intersection) ...
# write your solution here student_info = input("Student information: ") exercise_data = input("Exercises completed: ") names = {} with open(student_info) as new_file: for line in new_file: parts = line.split(";") # ignore the header line if parts[0] == "id": continue nam...
student_info = input('Student information: ') exercise_data = input('Exercises completed: ') names = {} with open(student_info) as new_file: for line in new_file: parts = line.split(';') if parts[0] == 'id': continue names[parts[0]] = parts[1].strip() + ' ' + parts[2].strip() exe...
def get_fact(i): res=1 for i in range(2,i+1): res*=i return res t=int(input()) for i in range(t): x=int(input()) print(get_fact(x))
def get_fact(i): res = 1 for i in range(2, i + 1): res *= i return res t = int(input()) for i in range(t): x = int(input()) print(get_fact(x))
def generate_new_image(text_encode, conditional_augmentation, generator): pass
def generate_new_image(text_encode, conditional_augmentation, generator): pass
__version__ = '0.0.2' def version(): return __version__
__version__ = '0.0.2' def version(): return __version__
expected_output = { "instance": { "default": { "vrf": { "EVPN-BGP-Table": { "address_family": { "l2vpn evpn": { "prefixes": { "[6][20.0.101.1:51][0][32][15.10.10.1][32][225.0.0...
expected_output = {'instance': {'default': {'vrf': {'EVPN-BGP-Table': {'address_family': {'l2vpn evpn': {'prefixes': {'[6][20.0.101.1:51][0][32][15.10.10.1][32][225.0.0.51][32][20.0.101.1]/27': {'table_version': '652975', 'nlri_data': {'route-type': '6', 'rd': '20.0.101.1:51', 'eti': '0', 'mcast_src_len': '32', 'mcast_...
# # Please get your login credentials at # winstantpay.com # userLogin = "" userPassword = "" APIKey = ""
user_login = '' user_password = '' api_key = ''
#linked list #To craete a node class Node: def __init__(self, dataval): self.dataval = dataval self.nextval = None class LinkedList: def __init__(self): self.headval = None #The code is to display def listprint(self): while self.headval is not None: print (self.headval.datav...
class Node: def __init__(self, dataval): self.dataval = dataval self.nextval = None class Linkedlist: def __init__(self): self.headval = None def listprint(self): while self.headval is not None: print(self.headval.dataval) self.headval = self.headv...
class TrackObject: def __init__(self, track_id, bbox, ttl): self.track_id = track_id self.bbox = bbox # To track an object if any bbox not found self.x_speed = 0.0 self.y_speed = 0.0 self.z_speed = 0.0 self.neighbour_ids = [] # Needs to check if a ne...
class Trackobject: def __init__(self, track_id, bbox, ttl): self.track_id = track_id self.bbox = bbox self.x_speed = 0.0 self.y_speed = 0.0 self.z_speed = 0.0 self.neighbour_ids = [] self.__is_updated = True self.__is_alive = True self.__ttl =...
# Combine characters in an array to a string alist = ["A", "B", "C"] astr = "".join(alist) print(astr) # Use list comprehension to manipulate bstr = "".join(cc + "-" for cc in alist) print(bstr) # Reverse the string cstr = "".join(alist[-1::-1]) print(cstr) # Put the string back to array astr = "Abhishek" alist = [...
alist = ['A', 'B', 'C'] astr = ''.join(alist) print(astr) bstr = ''.join((cc + '-' for cc in alist)) print(bstr) cstr = ''.join(alist[-1::-1]) print(cstr) astr = 'Abhishek' alist = [xx for xx in astr] print(alist)
class FakeServer(object): def __init__(self, slack=None, config=None, hooks=None, db=None): self.slack = slack or FakeSlack() self.config = config self.hooks = hooks self.db = db def query(self, sql, *params): # XXX: what to do with this? return None class FakeS...
class Fakeserver(object): def __init__(self, slack=None, config=None, hooks=None, db=None): self.slack = slack or fake_slack() self.config = config self.hooks = hooks self.db = db def query(self, sql, *params): return None class Fakeslack(object): def __init__(sel...
''' Author @sowjanyagarapati There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer extraCandies, denoting the number of extra candies that you have. Return a boolean array result of length n, where result[i] is true...
""" Author @sowjanyagarapati There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer extraCandies, denoting the number of extra candies that you have. Return a boolean array result of length n, where result[i] is true...
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. default_app_config = 'awx.ui.apps.UIConfig'
default_app_config = 'awx.ui.apps.UIConfig'
class Rectangle: def __init__(self, length, height): self.length = length self.height = height class Square(Rectangle): def __init__(self, length): Rectangle.__init__(self, length, length) @staticmethod def inscribe(radius): if radius is None or radius <= 0: raise ValueError(f"The rad...
class Rectangle: def __init__(self, length, height): self.length = length self.height = height class Square(Rectangle): def __init__(self, length): Rectangle.__init__(self, length, length) @staticmethod def inscribe(radius): if radius is None or radius <= 0: ...
{ "targets": [ { "target_name": "termios", "sources": [ "src/termios_basic.cpp", "src/node_termios.cpp" ], "include_dirs" : ['<!(node -e "require(\'nan\')")'], "cflags": ["-std=c++11"] } ] }
{'targets': [{'target_name': 'termios', 'sources': ['src/termios_basic.cpp', 'src/node_termios.cpp'], 'include_dirs': ['<!(node -e "require(\'nan\')")'], 'cflags': ['-std=c++11']}]}
# Copyright (c) 2015 # # All rights reserved. # # This file is distributed under the Clear BSD license. # The full text can be found in LICENSE in the root directory. def apt_install(device, name, timeout=120): apt_update(device) device.sendline('apt-get install -q -y %s' % name) device.expect('Reading pac...
def apt_install(device, name, timeout=120): apt_update(device) device.sendline('apt-get install -q -y %s' % name) device.expect('Reading package') device.expect(device.prompt, timeout=timeout) device.sendline('dpkg -l %s' % name) device.expect_exact('dpkg -l %s' % name) i = device.expect(['d...
# assume imports have been done and missing variables have been set nwbfile = NWBFile(session_description='A description for this session', identifier='Mouse10-Day1', session_start_time=start_time) myTimeSeries = TimeSeries(name='MyTimeSeries', data=data, ...
nwbfile = nwb_file(session_description='A description for this session', identifier='Mouse10-Day1', session_start_time=start_time) my_time_series = time_series(name='MyTimeSeries', data=data, unit='m', timestamps=timestamps) nwbfile.add_acquisition(myTimeSeries) print(nwbfile.acquisition['MyTimeSeries'])
# class Kettle(object): # # def __init__(self, make, model, year): # self.make = make # self.model = model # self.year = year # # # fordTaurus = Kettle('Ford', 'Taurus', 2007) # print(fordTaurus.make) # print(fordTaurus.model) # print(fordTaurus.year) # # fordTaurus.year = 2008 ...
class Kettle(object): power_source = 'electricity' def __init__(self, make, price): self.make = make self.price = price self.on = False def switch_on(self): self.on = True kenwood = kettle('kenwood', 8.99) print(kenwood.make) print(kenwood.price) print(kenwood.on) kenwood.s...
# list comprehension and generator expressions # example of a list comprehension (one liner for loops) xyz = [i for i in range(5)] print(xyz) # which can also be written out as abc = [] for i in range(5): abc.append(i) print(abc) # to go from list comprehension to generator # change the brackets to parenthesis ...
xyz = [i for i in range(5)] print(xyz) abc = [] for i in range(5): abc.append(i) print(abc) xyz = [i for i in range(5)] print(xyz) xyz = (i for i in range(5)) print(xyz) xyz = [i for i in range(50000000)] print('done') xyz = (i for i in range(50000000)) print(xyz) input_list = [5, 6, 3, 15, 10, 3, 7, 40, 25, 33, 98...
class TradeModeEnum: TRADE_MODE_UNSET = 0 TRADE_MODE_DEMO = 1 TRADE_MODE_SIMULATED = 2 TRADE_MODE_LIVE = 3
class Trademodeenum: trade_mode_unset = 0 trade_mode_demo = 1 trade_mode_simulated = 2 trade_mode_live = 3
# # PySNMP MIB module DNS-RESOLVER-MIB (http://pysnmp.sf.net) # ASN.1 source http://mibs.snmplabs.com:80/asn1/DNS-RESOLVER-MIB # Produced by pysmi-0.0.7 at Sun Feb 14 00:08:40 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)...
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, single_value_constraint, constraints_union, constraints_intersection) ...
# COVID-19 datasets # # m.mieskolainen@imperial.ac.uk, 2020 ''' # Miami-Dade County # https://rwilli5.github.io/MiamiCovidProject MIA = { 'filename_cases' : '', 'filename_deaths' : 'covid-19-miami-dade_deaths-by-day.csv', 'filename_tested' : '', 'region' : 'Dade', # Miami-Dade 'isocode' ...
""" # Miami-Dade County # https://rwilli5.github.io/MiamiCovidProject MIA = { 'filename_cases' : '', 'filename_deaths' : 'covid-19-miami-dade_deaths-by-day.csv', 'filename_tested' : '', 'region' : 'Dade', # Miami-Dade 'isocode' : 'MIA', 'function' : 'data_reader_florida'...
class ListStack: def __init__(self): self._L = [] def push(self, item): self._L.append(item) def pop(self): return self._L.pop() def peek(self): return self._L[:-1] def __len__(self): return len(self._L) def is_empty(self): return len(self) ==...
class Liststack: def __init__(self): self._L = [] def push(self, item): self._L.append(item) def pop(self): return self._L.pop() def peek(self): return self._L[:-1] def __len__(self): return len(self._L) def is_empty(self): return len(self) =...
def city(T): # build adjacency list adj = [[] for i in range(len(T))] root = 0 for i in range(len(T)): t = T[i] if i == t: root = i continue adj[i].append(t) adj[t].append(i) # bfs q = [root] visited = [False for i in range(len(T))] ...
def city(T): adj = [[] for i in range(len(T))] root = 0 for i in range(len(T)): t = T[i] if i == t: root = i continue adj[i].append(t) adj[t].append(i) q = [root] visited = [False for i in range(len(T))] visited[root] = True lst = [] ...
# File: roman_numerals.py # Purpose: Function to convert from normal numbers to Roman Numerals. # Programmer: Amal Shehu # Course: Exercism # Date: Saturday 17 September 2016, 03:30 PM numerals = tuple(zip( (1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1), ('M', 'CM', 'D', 'CD', '...
numerals = tuple(zip((1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1), ('M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'))) def numeral(num): roman = [] for (number, numeral) in numerals: swing = num // number roman.append(numeral * swing) num -= number * swin...
#!/usr/bin/env python # coding: utf-8 # # <a href="https://colab.research.google.com/github/aviadr1/learn-advanced-python/blob/master/content/02_closures_and_decorators/variadic_functions.ipynb" target="_blank"> # <img src="https://colab.research.google.com/assets/colab-badge.svg" # title="Open this file in Goo...
print(1, 2, 3) print() print(1, 2, 3, 4, 5, 6, 7, 8, 8, 10) def blah(x, y): print(x, y) blah(1, 2) def variadic_func1(*args): print(type(args)) print(args) print(*args) variadic_func1(1, 2, 3, 4, 5, 6, 7, 'goodbye') dict(did_you_notice='that', i_can='add as many', keyword_arguments='as I want', to_the...
def diStringMatch(S: str): lo, hi = 0, len(S) res = [] for c in S: if c == 'I': res.append(lo) lo+=1 else: res.append(hi) hi-=1 return res+[lo] print(diStringMatch("IDIDID"))
def di_string_match(S: str): (lo, hi) = (0, len(S)) res = [] for c in S: if c == 'I': res.append(lo) lo += 1 else: res.append(hi) hi -= 1 return res + [lo] print(di_string_match('IDIDID'))
print("Please input your number:") number= int(input()) temp= number while number>1: number-=1 temp= temp*number if number== 0: print(1) else: print(temp)
print('Please input your number:') number = int(input()) temp = number while number > 1: number -= 1 temp = temp * number if number == 0: print(1) else: print(temp)
''' Created on Aug 6, 2015 @author: hashtonmartyn '''
""" Created on Aug 6, 2015 @author: hashtonmartyn """
# encoding: utf-8 class Gamercard: def __init__(self, gamertag: str, name: str, location: str, bio: str, gamerscore: int, tier: str, motto: str, avatar_body_image_path: str, gamerpic_small_image_path: str, gamerpic_small_ssl_image_path: str, gamerpic_large_image_path: str, gamerpi...
class Gamercard: def __init__(self, gamertag: str, name: str, location: str, bio: str, gamerscore: int, tier: str, motto: str, avatar_body_image_path: str, gamerpic_small_image_path: str, gamerpic_small_ssl_image_path: str, gamerpic_large_image_path: str, gamerpic_large_ssl_image_path: str, avatar_manifest: str): ...
print("Hello, World!") name = input("What is your name? "); print("Hello, " + name); name = input("What is your name? "); print("So you call yourself '" + name + "' huh?") friend1 = input("Friend: "); friend2 = input("Friend: "); friend3 = input("Friend: "); print("Hello, young " + frien...
print('Hello, World!') name = input('What is your name? ') print('Hello, ' + name) name = input('What is your name? ') print("So you call yourself '" + name + "' huh?") friend1 = input('Friend: ') friend2 = input('Friend: ') friend3 = input('Friend: ') print('Hello, young ' + friend1) print('Hello, wise ' + friend2) pr...
L = [1,[2,[3,4],5],6,[7,8]] # this is recursion def recursive(L): total = 0 for x in L: if not isinstance(x, list): total += x print(x) else: total += recursive(x) return total print("Perform recursion :") total = recursive(L) print(total) #this is bre...
l = [1, [2, [3, 4], 5], 6, [7, 8]] def recursive(L): total = 0 for x in L: if not isinstance(x, list): total += x print(x) else: total += recursive(x) return total print('Perform recursion :') total = recursive(L) print(total) def bread_first(L): tot...
# # PySNMP MIB module H3C-DHCP-SERVER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-DHCP-SERVER-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:08:19 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, single_value_constraint, constraints_intersection, constraints_union) ...
NUM_SAILORS = 5 NUM_ITERATIONS = 6 UPPER_BOUND = 1000000 def check(pile, verbose=False): for i in range(0, NUM_ITERATIONS): share, monkey = divmod(pile, NUM_SAILORS) if monkey == 1: new_pile = pile - (share + monkey) if verbose: print ("%d: share [%d] monkey ...
num_sailors = 5 num_iterations = 6 upper_bound = 1000000 def check(pile, verbose=False): for i in range(0, NUM_ITERATIONS): (share, monkey) = divmod(pile, NUM_SAILORS) if monkey == 1: new_pile = pile - (share + monkey) if verbose: print('%d: share [%d] monkey...
def assemble_payload(payload_str:str): payload_len = len(payload_str) #can be up to two bytes (16 bits) payload_str = payload_str.encode() #this is where we may need to generate random data to avoid padding issues if len(payload_str) < 992: payload_str = payload_str + (b'\xFF' * (992 - len(payload_str...
def assemble_payload(payload_str: str): payload_len = len(payload_str) payload_str = payload_str.encode() if len(payload_str) < 992: payload_str = payload_str + b'\xff' * (992 - len(payload_str)) payload_segments = [payload_str[i:i + 32] for i in range(31)] return (payload_str, payload_len.t...
ed=int(input("DIGITE SU EDAD PORFAVOR:")) while (ed<18): print("usted es menor de edad") ed=int(input("DIGITE SU EDAD PORFAVOR:")) print("ERES MAYOR DE EDAD")
ed = int(input('DIGITE SU EDAD PORFAVOR:')) while ed < 18: print('usted es menor de edad') ed = int(input('DIGITE SU EDAD PORFAVOR:')) print('ERES MAYOR DE EDAD')
# https://leetcode.com/problems/binary-tree-paths # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def __init__(self): self.ans = [] def backtr...
class Solution: def __init__(self): self.ans = [] def backtrack(self, node, cur): if not node.left and (not node.right): item = '->'.join(cur) self.ans.append(item) if node.left: cur.append(str(node.left.val)) self.backtrack(node.left, cu...
for _ in range(int(input())): a = input() b = list(str((int(a))**2)) b.reverse() b = "".join(b) a = list(a) a.reverse() a = "".join(a) if a == b[:len(a)]: print("YES") else: print("NO")
for _ in range(int(input())): a = input() b = list(str(int(a) ** 2)) b.reverse() b = ''.join(b) a = list(a) a.reverse() a = ''.join(a) if a == b[:len(a)]: print('YES') else: print('NO')
# In this program, you read two numbers from the input and print a larger number in the output. # The first input line contains the first number. The second input line contains the second number. # It is guaranteed that the input numbers are positive integers. If two input numbers are not equal, print one of them. x =...
x = int(input()) y = int(input()) if x > y: print(x) elif y > x: print(y) else: print(x or y)
#!/usr/bin/env python3 # # --- Day 4: Giant Squid --- # # You're already almost 1.5km (almost a mile) below the surface of the ocean, # already so deep that you can't see any sunlight. What you can see, however, # is a giant squid that has attached itself to the outside of your submarine. # # Maybe it wants to play bin...
input_file = 'input.txt' def main(): with open(INPUT_FILE, 'r') as file: puzzle_input = file.read().split('\n\n') numbers_drown = puzzle_input[0] boards_definitions = puzzle_input[1:] numbers = [int(number) for number in numbers_drown.strip().split(',')] boards = [] for board_definition...
# Copyright (c) 2021, Oracle and/or its affiliates. # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. # # This is an example of using WLST to add logout to ADF pages # connect('<OAM_WEBLOGIC_USER>','<OAM_WEBLOGIC_PWD>','t3://<OAM_DOMAIN_NAME>-adminserver.<OAMNS>.sv...
connect('<OAM_WEBLOGIC_USER>', '<OAM_WEBLOGIC_PWD>', 't3://<OAM_DOMAIN_NAME>-adminserver.<OAMNS>.svc.cluster.local:<OAM_ADMIN_PORT>') add_oamsso_provider(loginuri='/${app.context}/adfAuthentication', logouturi='/oam/logout.html') exit()
class Solution: def sortSentence(self, s: str) -> str: words, wordMap, result = s.split(' '), defaultdict(str), [] for word in words: wordMap[word[-1]] = word[:-1] for index in sorted(wordMap.keys()): result.append(wordMap[index]) return ' '.join(result)
class Solution: def sort_sentence(self, s: str) -> str: (words, word_map, result) = (s.split(' '), defaultdict(str), []) for word in words: wordMap[word[-1]] = word[:-1] for index in sorted(wordMap.keys()): result.append(wordMap[index]) return ' '.join(result...
class Commodity: def __init__(self, conn, id, name, average): self.conn = conn self.id = id self.name = name self.average = average def getName(self): return self.name def getId(self): return self.id def getAverage(self): return self.average def __str__(self): return self....
class Commodity: def __init__(self, conn, id, name, average): self.conn = conn self.id = id self.name = name self.average = average def get_name(self): return self.name def get_id(self): return self.id def get_average(self): return self.average...
#!/usr/bin/python3 def replace_in_list(my_list, idx, element): if idx < 0: return my_list for index in range(len(my_list)): if index == idx: my_list[index] = element return my_list
def replace_in_list(my_list, idx, element): if idx < 0: return my_list for index in range(len(my_list)): if index == idx: my_list[index] = element return my_list
class Solution: # @return a string def minWindow(self, S, T): count1={}; count2={} for char in T: if char not in count1: count1[char]=1 else: count1[char]+=1 for char in T: if char not in count2: count2[char]=1 else: count2[char]+=1 ...
class Solution: def min_window(self, S, T): count1 = {} count2 = {} for char in T: if char not in count1: count1[char] = 1 else: count1[char] += 1 for char in T: if char not in count2: count2[char] =...
SAMPLE_PROFIT_CENTERS = [ { 'id': 1, 'name': 'Profit Center #1', 'description': 'Profit Center #1 description', }, { 'id': 2, 'name': 'Profit Center #2', 'description': 'Profit Center #2 description', }, ]
sample_profit_centers = [{'id': 1, 'name': 'Profit Center #1', 'description': 'Profit Center #1 description'}, {'id': 2, 'name': 'Profit Center #2', 'description': 'Profit Center #2 description'}]
materia1 = float(input('Qual a nota da mateira 1: ')) materia2 = float(input('Qual a nota da mateira 2: ')) materia3 = float(input('Qual a nota da mateira 3: ')) if (materia1 >= 7 and materia2 >= 7 and materia3 >= 7): print ('Passou de ano') print('Nota da materia1: {}' .format(materia1)) print('Nota da mat...
materia1 = float(input('Qual a nota da mateira 1: ')) materia2 = float(input('Qual a nota da mateira 2: ')) materia3 = float(input('Qual a nota da mateira 3: ')) if materia1 >= 7 and materia2 >= 7 and (materia3 >= 7): print('Passou de ano') print('Nota da materia1: {}'.format(materia1)) print('Nota da mater...
BODY_CABRI_2 = 'Cabriolet, 2-Door' BODY_COUPE_2 = 'Coupe, 2-Door' BODY_CROSS_3 = 'Crossover, 3-Door' BODY_PICKUP_2 = 'Pickup, 2-Door' BODY_HATCH_3 = 'Hatchback, 3-Door' BODY_HATCH_5 = 'Hatchback, 5-Door' BODY_MINIVAN_3 = 'Minivan, 3-Door' BODY_MINIVAN_5 = 'Minivan, 5-Door' BODY_SEDAN_4 = 'Sedan, 4-Door' BODY_SEDAN_...
body_cabri_2 = 'Cabriolet, 2-Door' body_coupe_2 = 'Coupe, 2-Door' body_cross_3 = 'Crossover, 3-Door' body_pickup_2 = 'Pickup, 2-Door' body_hatch_3 = 'Hatchback, 3-Door' body_hatch_5 = 'Hatchback, 5-Door' body_minivan_3 = 'Minivan, 3-Door' body_minivan_5 = 'Minivan, 5-Door' body_sedan_4 = 'Sedan, 4-Door' body_sedan_2 = ...
# In order to write the DataFrame `americas` to a file called `processed.csv`, # execute the following command: americas.to_csv('processed.csv') # For help on `to_csv`, you could execute, for example, help(americas.to_csv) # Note that `help(to_csv)` throws an error! This is a subtlety and is due to # th...
americas.to_csv('processed.csv') help(americas.to_csv)
if __name__ == '__main__': n = int(input()) if(n%2 !=0): print('Weird') else: if(n>=2 and n<=5): print ('Not Weird') elif(n>=6 and n<=20): print ('Weird') else: print ('Not Weird')
if __name__ == '__main__': n = int(input()) if n % 2 != 0: print('Weird') elif n >= 2 and n <= 5: print('Not Weird') elif n >= 6 and n <= 20: print('Weird') else: print('Not Weird')
class Pattern_Thirty_Two: '''Pattern thirty_two * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
class Pattern_Thirty_Two: """Pattern thirty_two * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...