content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class Command: def __init__(self, function, *args): self.function = function self.args = list(args) def execute(self): self.function(*self.args)
class Command: def __init__(self, function, *args): self.function = function self.args = list(args) def execute(self): self.function(*self.args)
class Arbol: def __init__(self, instructions): self.instrucciones:list = instructions self.console:list = []
class Arbol: def __init__(self, instructions): self.instrucciones: list = instructions self.console: list = []
""" This program demonstrates printing output. """ room = 503 #Represents a hotel room number that a person is staying in print("I am staying in room number", room) #Prints the person's room number top_speed = 125 ...
""" This program demonstrates printing output. """ room = 503 print('I am staying in room number', room) top_speed = 125 speed_string = 'The top speed is' print(speed_string, top_speed, 'miles per hour.') distance = 300.75 print('The distance traveled is', distance, 'miles.')
# tag::Map[] class SeatMap(): def loadFromFile(self, filename): """Read file to map""" self._rows = [] self.width = 0 file = open(filename, "r") for line in file: self._rows.append(line.strip()) self.width = max(self.width,len(line.strip())) ...
class Seatmap: def load_from_file(self, filename): """Read file to map""" self._rows = [] self.width = 0 file = open(filename, 'r') for line in file: self._rows.append(line.strip()) self.width = max(self.width, len(line.strip())) self.height =...
# # PySNMP MIB module ZHNSYSMON (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHNSYSMON # Produced by pysmi-0.3.4 at Mon Apr 29 21:40:22 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23...
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_union, constraints_intersection, single_value_constraint, value_range_constraint) ...
# ---------------------------------------------------------------------------- # CLASSES: nightly # # Test Case: ProteinDataBank.py # # Tests: mesh - 3D points # plots - Molecule # # Programmer: Brad Whitlock # Date: Tue Mar 28 15:46:53 PST 2006 # # Modifications: # Jeremy Mer...
def label_test(testname, var, zoomview): add_plot('Label', var) label_atts = label_attributes() LabelAtts.legendFlag = 1 LabelAtts.showNodes = 0 LabelAtts.showCells = 1 LabelAtts.restrictNumberOfLabels = 0 LabelAtts.drawLabelsFacing = LabelAtts.Front LabelAtts.labelDisplayFormat = LabelA...
# bot token (from @BotFather) TOKEN = '' LOG_FILE = './logs/botlog.log'
token = '' log_file = './logs/botlog.log'
def countSquareMatrices(a, N, M): count = 0 for i in range(1, N): for j in range(1, M): if (a[i][j] == 0): continue # Calculating number of square submatrices ending at (i, j) a[i][j] = min([a[i - 1][j], a[i][j - 1], a[i - 1][j - 1]])+1 # Calc...
def count_square_matrices(a, N, M): count = 0 for i in range(1, N): for j in range(1, M): if a[i][j] == 0: continue a[i][j] = min([a[i - 1][j], a[i][j - 1], a[i - 1][j - 1]]) + 1 for i in range(N): for j in range(M): count += a[i][j] re...
'''You are given a binary array nums (0-indexed). We define xi as the number whose binary representation is the subarray nums[0..i] (from most-significant-bit to least-significant-bit). For example, if nums = [1,0,1], then x0 = 1, x1 = 2, and x2 = 5. Return an array of booleans answer where answer[i] is true if xi is...
"""You are given a binary array nums (0-indexed). We define xi as the number whose binary representation is the subarray nums[0..i] (from most-significant-bit to least-significant-bit). For example, if nums = [1,0,1], then x0 = 1, x1 = 2, and x2 = 5. Return an array of booleans answer where answer[i] is true if xi is...
class QueryNotYetStartError(Exception): """Raises error if the query has not yet started""" class NotFetchQueryResultError(Exception): """Raises error if the query result could not be fetched""" class QueryTimeoutError(Exception): """Raises timeout error if the query timeout""" class QueryAlreadyCance...
class Querynotyetstarterror(Exception): """Raises error if the query has not yet started""" class Notfetchqueryresulterror(Exception): """Raises error if the query result could not be fetched""" class Querytimeouterror(Exception): """Raises timeout error if the query timeout""" class Queryalreadycancelle...
ES_HOST = 'localhost:9200' ES_INDEX = 'pending-cord_anatomy' ES_DOC_TYPE = 'anatomy' API_PREFIX = 'cord_anatomy' API_VERSION = ''
es_host = 'localhost:9200' es_index = 'pending-cord_anatomy' es_doc_type = 'anatomy' api_prefix = 'cord_anatomy' api_version = ''
my_cars = ["Lamborghini","Ford","Ferrari"] my_cars[1] = "Ford Titanium" print (my_cars) my_cars = ["Lamborghini","Ford","Ferrari"] print (len(my_cars)) my_cars = ["Lamborghini","Ford","Ferrari"] del my_cars [0] print (my_cars) my_cars = ["Lamborghini","Ford","Ferrari"] my_cars0 = list(my_cars) print (my_cars0) my_c...
my_cars = ['Lamborghini', 'Ford', 'Ferrari'] my_cars[1] = 'Ford Titanium' print(my_cars) my_cars = ['Lamborghini', 'Ford', 'Ferrari'] print(len(my_cars)) my_cars = ['Lamborghini', 'Ford', 'Ferrari'] del my_cars[0] print(my_cars) my_cars = ['Lamborghini', 'Ford', 'Ferrari'] my_cars0 = list(my_cars) print(my_cars0) my_ca...
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
def attestation_attestation_provider_list(client, resource_group_name=None): if resource_group_name: return client.list_by_resource_group(resource_group_name=resource_group_name) return client.list() def attestation_attestation_provider_show(client, resource_group_name, provider_name): return clien...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
"""Rules for defining OpenROAD configuration for various PDKs""" open_road_pdk_info = provider('provider for openROAD configuration for a pdk', fields={'cell_site': 'LEF standard cell site name to use for floorplanning', 'tracks_file': 'Track setup script', 'endcap_cell': 'The endcap cell to use in place and route', 't...
class LandException(Exception): """ Custom exception to instruct the tello_script_runner that a user script would like to land. """ pass
class Landexception(Exception): """ Custom exception to instruct the tello_script_runner that a user script would like to land. """ pass
s=input("Enter string:") n=int(input("Enter no. of substring:")) l=[] print("Enter substrings: ") for i in range(n): substr1=input() substr2=list(substr1) a=[] count=0 l1=[a] for i in range(len(s)): x=l1[:] new=s[i] for j in range(len(l1)): l1[j]=l1[j]+[new] ...
s = input('Enter string:') n = int(input('Enter no. of substring:')) l = [] print('Enter substrings: ') for i in range(n): substr1 = input() substr2 = list(substr1) a = [] count = 0 l1 = [a] for i in range(len(s)): x = l1[:] new = s[i] for j in range(len(l1)): ...
""" """ class LoadError(Exception): """ Represents the error raised from loading a library """ def __init__(self, message): super().__init__(message) self.message = message # Added because it is missing after super init def __repr__(self): return f'ParserError(message="{self.mes...
""" """ class Loaderror(Exception): """ Represents the error raised from loading a library """ def __init__(self, message): super().__init__(message) self.message = message def __repr__(self): return f'ParserError(message="{self.message}")'
print("hello") ''' import streamlit as st from streamlit_webrtc import ( ClientSettings, VideoTransformerBase, WebRtcMode, webrtc_streamer, ) webrtc_ctx = webrtc_streamer( key="object-detection", mode=WebRtcMode.SENDRECV, client_settings=WEBRTC_CLIENT_SETTINGS, ...
print('hello') '\n\nimport streamlit as st\nfrom streamlit_webrtc import (\n ClientSettings,\n VideoTransformerBase,\n WebRtcMode,\n webrtc_streamer,\n)\n\nwebrtc_ctx = webrtc_streamer(\n key="object-detection",\n mode=WebRtcMode.SENDRECV,\n client_settings=WEBRTC_CLIENT_SETTINGS,\n ...
# Definition for a binary tree node. """ timecomplexity = O(n) Space complexity : O(log(N)) in the best case of completely balanced tree and )O(N) in the worst case of completely unbalanced tree, to keep a recursion stack. construct recusive function check the special tase: two empty tree and one empty one unempty ,...
""" timecomplexity = O(n) Space complexity : O(log(N)) in the best case of completely balanced tree and )O(N) in the worst case of completely unbalanced tree, to keep a recursion stack. construct recusive function check the special tase: two empty tree and one empty one unempty , if the value in two treenode is the ...
{ "targets": [ { "target_name": "addon", "sources": [ "src/addon.cc" ], "include_dirs": ["<!(node -p \"require('node-addon-api').include_dir\")"], "defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ], "cflags!": [ "-fno-exceptions" ], "cflags_cc!": [ "-fno-exceptions" ], "conditi...
{'targets': [{'target_name': 'addon', 'sources': ['src/addon.cc'], 'include_dirs': ['<!(node -p "require(\'node-addon-api\').include_dir")'], 'defines': ['NAPI_DISABLE_CPP_EXCEPTIONS'], 'cflags!': ['-fno-exceptions'], 'cflags_cc!': ['-fno-exceptions'], 'conditions': [["OS=='win'", {'defines': ['_HAS_EXCEPTIONS=1'], 'ms...
## 6. Write a program that asks the user to input 10 integers, and # then prints the largest odd number that was entered. If no odd number was # entered, it should print a message to that effect. # Kullaniciya 10 adet tamsayi isteyen ve girilen sayilar icindeki en buyuk tek # sayiyi yazdiran programi yaziniz. Eg...
sayi = None for _ in range(10): deger = int(input('Bir deger giriniz: ')) if deger % 2 and (sayi is None or deger > sayi): sayi = deger if sayi: print('Girilen en buyuk sayi', sayi) else: print('Tek sayi bulunamadi.')
""" Created by GigX Studio """ class RequestResult: success = False data = None code = -1 def __init__(self, success, data, code): self.success = success self.data = data self.code = code def getCode(self): return self.code def getData(self): return se...
""" Created by GigX Studio """ class Requestresult: success = False data = None code = -1 def __init__(self, success, data, code): self.success = success self.data = data self.code = code def get_code(self): return self.code def get_data(self): return ...
class Solution: def countBalls(self, lowLimit: int, highLimit: int) -> int: hashMap = {} max_value = 0 for box_id in range(lowLimit, highLimit+1): runner = box_id box_num = 0 while runner > 0: box_num += (runner%10) runner /...
class Solution: def count_balls(self, lowLimit: int, highLimit: int) -> int: hash_map = {} max_value = 0 for box_id in range(lowLimit, highLimit + 1): runner = box_id box_num = 0 while runner > 0: box_num += runner % 10 run...
"""Reforemast global settings.""" class Settings: # pylint: disable=locally-disabled,too-few-public-methods """Reforemast settings.""" def __init__(self): self.auto_apply = False self.gate_url = 'https://gate.spinnaker.com' self.application_updaters = [] self.pipeline_update...
"""Reforemast global settings.""" class Settings: """Reforemast settings.""" def __init__(self): self.auto_apply = False self.gate_url = 'https://gate.spinnaker.com' self.application_updaters = [] self.pipeline_updaters = [] self.stage_updaters = [] settings = settings(...
# -*- coding: utf-8 -*- class Solution(object): def sortedSquares(self, A): """ :type A: List[int] :rtype: List[int] """ size = len(A) res = [0] * size l, r, i = 0, size - 1, size - 1 while l <= r: if A[l] + A[r] < 0: r...
class Solution(object): def sorted_squares(self, A): """ :type A: List[int] :rtype: List[int] """ size = len(A) res = [0] * size (l, r, i) = (0, size - 1, size - 1) while l <= r: if A[l] + A[r] < 0: res[i] = A[l] * A[l] ...
priorities = [ ('Low', 'LOW'), ('Medium', 'MEDIUM'), ('High', 'HIGH'), ('Urgent', 'URGENT'), ('Emergency', 'EMERGENCY') ] bootstrap_priorities = [ 'text-default', 'text-success', 'text-info', 'text-warning', 'text-danger' ] action_types = [ ('PreProcessor', 'PREPROCESSOR'),...
priorities = [('Low', 'LOW'), ('Medium', 'MEDIUM'), ('High', 'HIGH'), ('Urgent', 'URGENT'), ('Emergency', 'EMERGENCY')] bootstrap_priorities = ['text-default', 'text-success', 'text-info', 'text-warning', 'text-danger'] action_types = [('PreProcessor', 'PREPROCESSOR'), ('Notification', 'NOTIFICATION'), ('Logic', 'LOGIC...
def decrescent(number_items, weight_max, values_items, weight_items): items = {} for i in range(number_items): items[i] = values_items[i],weight_items[i] items = sorted(items.values(), reverse=True) result_final = 0 weight = 0 for values_items,weight_items in items: if weight_items+weight <= weight_max: res...
def decrescent(number_items, weight_max, values_items, weight_items): items = {} for i in range(number_items): items[i] = (values_items[i], weight_items[i]) items = sorted(items.values(), reverse=True) result_final = 0 weight = 0 for (values_items, weight_items) in items: if weig...
def add_one(number): return number + 1 def add_one(number): return number + 2
def add_one(number): return number + 1 def add_one(number): return number + 2
'''a = 10 b = 4 print("Value of a : ",a) print("Background str method will invoke so that we are getting a value not address : ",a.__str__()) print("Addition : ", a + b) print("Background Method addition using int class : ", int.__add__(a, b)) ''' class Student: def __init__(self,m1,m2): self.m1 = m1 ...
"""a = 10 b = 4 print("Value of a : ",a) print("Background str method will invoke so that we are getting a value not address : ",a.__str__()) print("Addition : ", a + b) print("Background Method addition using int class : ", int.__add__(a, b)) """ class Student: def __init__(self, m1, m2): self.m1 = m1 ...
# Resta x, y, z = 10, 23, 5 a = x - y - z # -18 a = x - x - x # -10 a = y - y - y - y # -46 a = z - y - z # -23 a = z - z - z # -5 a = y - y - z # -5 print("Final")
(x, y, z) = (10, 23, 5) a = x - y - z a = x - x - x a = y - y - y - y a = z - y - z a = z - z - z a = y - y - z print('Final')
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Copyright 2014 Michele Filannino # # gnTEAM, School of Computer Science, University of Manchester. # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU General Public License. # # author: Michele Filannino #...
properties = {} properties['MAIN_DIR'] = '/home/filannim/Dropbox/Workspace/ManTIME/temporal_location/' properties['HEIDELTIME_DIR'] = '/home/filannim/Downloads/heideltime-standalone-1.5/' properties['WIKIPEDIA2TEXT'] = '/home/filannim/Dropbox/Workspace/ManTIME/temporal_location/external/wikipedia2text'
PHYSIO_LOG_RULES = [ { "key": "ImageType", "value": [("ORIGINAL", "PRIMARY", "RAWDATA", "PHYSIO")], "lookup": "exact", "operator": "any", }, ]
physio_log_rules = [{'key': 'ImageType', 'value': [('ORIGINAL', 'PRIMARY', 'RAWDATA', 'PHYSIO')], 'lookup': 'exact', 'operator': 'any'}]
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") def _serialize_file(file): """Serializes a file into a struct that matches the `BazelFileInfo` type in the packager implementation. Useful for transmission of such information.""" return struct(path = file.path, shortPath = file.short_path) d...
load('@build_bazel_rules_nodejs//:index.bzl', 'nodejs_test') def _serialize_file(file): """Serializes a file into a struct that matches the `BazelFileInfo` type in the packager implementation. Useful for transmission of such information.""" return struct(path=file.path, shortPath=file.short_path) def _c...
def solve(limit: int): """Solve project euler problem 95.""" sum_divs = [1] * (limit + 2) # Stores sum of proper divisors amicables = {1} # Max numbers in amicable chains max_length = 0 max_list_min = None for i in range(2, limit + 1): # As only sums up to i calculated, only chains st...
def solve(limit: int): """Solve project euler problem 95.""" sum_divs = [1] * (limit + 2) amicables = {1} max_length = 0 max_list_min = None for i in range(2, limit + 1): sum_proper = chain_min = i length = 1 while (sum_proper := sum_divs[sum_proper]) <= i and sum_proper ...
class Solution: def diffByOneCharacter(self, word1: str, word2: str) -> bool: counter = 0 for i in range(len(word1)): if word1[i] != word2[i]: counter += 1 if counter > 1: return False return counter == 1 def helper(self, beginWord: str, end...
class Solution: def diff_by_one_character(self, word1: str, word2: str) -> bool: counter = 0 for i in range(len(word1)): if word1[i] != word2[i]: counter += 1 if counter > 1: return False return counter == 1 def helper(sel...
PICKUP = 'pickup' DROPOFF = 'dropoff' # # Time complexity: O(n*log(n)) (due the sorting) # Space complexity: O(1) # def active_time(events): # sort the events by timestamp events.sort(key=lambda event: event[1]) active_deliveries = 0 start_timestamp = 0 acc_active_time = 0 for event in events: _, t...
pickup = 'pickup' dropoff = 'dropoff' def active_time(events): events.sort(key=lambda event: event[1]) active_deliveries = 0 start_timestamp = 0 acc_active_time = 0 for event in events: (_, timestamp, action) = event if action == PICKUP: active_deliveries += 1 ...
# # Created on Wed Dec 22 2021 # # Copyright (c) 2021 Lenders Cooperative, a division of Summit Technology Group, Inc. # def test_create_and_delete_subscriber_with_django_user(client, django_user): results = client.create_subscriber(email=django_user.email, name=django_user.username) data = results["data"] ...
def test_create_and_delete_subscriber_with_django_user(client, django_user): results = client.create_subscriber(email=django_user.email, name=django_user.username) data = results['data'] new_user_id = data['id'] assert isinstance(data['id'], int) assert data['name'] == django_user.username asser...
class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: dict = {} for i, v in enumerate(nums): if target - v in dict: return dict[target - v] , i elif v not in dict: dict[v] = i return []
class Solution: def two_sum(self, nums: List[int], target: int) -> List[int]: dict = {} for (i, v) in enumerate(nums): if target - v in dict: return (dict[target - v], i) elif v not in dict: dict[v] = i return []
class DataGridTextColumn(DataGridBoundColumn): """ Represents a System.Windows.Controls.DataGrid column that hosts textual content in its cells. DataGridTextColumn() """ DataGridOwner = property( lambda self: object(), lambda self, v: None, lambda self: None ) """Gets the Sys...
class Datagridtextcolumn(DataGridBoundColumn): """ Represents a System.Windows.Controls.DataGrid column that hosts textual content in its cells. DataGridTextColumn() """ data_grid_owner = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Gets the System.Windows.Controls.DataGr...
def solution(participant, completion): answer = '' val={} for i in participant: if i in val.keys(): val[i]=val[i]+1 else: val[i]=1 for i in completion: val[i]-=1 for i in val.keys(): if val[i]>0: answer...
def solution(participant, completion): answer = '' val = {} for i in participant: if i in val.keys(): val[i] = val[i] + 1 else: val[i] = 1 for i in completion: val[i] -= 1 for i in val.keys(): if val[i] > 0: answer = i b...
soma = lambda a, b: a+b multiplica = lambda a, b, c: (a + b) * c r = soma(5, 10) print(r) print(multiplica(5, 3, 10)) print((lambda a, b: a + b)(3, 5)) r = lambda x, func: x + func(x) print(r(2, lambda a: a*a))
soma = lambda a, b: a + b multiplica = lambda a, b, c: (a + b) * c r = soma(5, 10) print(r) print(multiplica(5, 3, 10)) print((lambda a, b: a + b)(3, 5)) r = lambda x, func: x + func(x) print(r(2, lambda a: a * a))
file = open("input.txt", "r") for line in file: print(line) file.close()
file = open('input.txt', 'r') for line in file: print(line) file.close()
def increment_and_return(x): return ++x CONSTANT = 777 ++CONSTANT
def increment_and_return(x): return ++x constant = 777 ++CONSTANT
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' def number_to_k_notation(number: int) -> str: k = 0 while True: if number // 1000 == 0: break number /= 1000 k += 1 return str(round(number)) + 'k' * k if __name__ == '__main__': print(numb...
__author__ = 'ipetrash' def number_to_k_notation(number: int) -> str: k = 0 while True: if number // 1000 == 0: break number /= 1000 k += 1 return str(round(number)) + 'k' * k if __name__ == '__main__': print(number_to_k_notation(123)) assert number_to_k_notation...
""" Public exceptions and warnings """ class CasefileNotFoundError(FileNotFoundError): """ Raised when casefile cannot be found. """ class CasefileQueryError(ValueError): """ Raised if more than one casefile returned when querying database. Case ID is unique, so should only return one file. ...
""" Public exceptions and warnings """ class Casefilenotfounderror(FileNotFoundError): """ Raised when casefile cannot be found. """ class Casefilequeryerror(ValueError): """ Raised if more than one casefile returned when querying database. Case ID is unique, so should only return one file. ...
class ElementTypeGroup(Enum, IComparable, IFormattable, IConvertible): """ The element type group. enum ElementTypeGroup,values: AnalyticalLinkType (136),AngularDimensionType (37),ArcLengthDimensionType (38),AreaLoadType (82),AreaReinforcementType (87),AttachedDetailGroupType (34),BeamSystemType (54),Bu...
class Elementtypegroup(Enum, IComparable, IFormattable, IConvertible): """ The element type group. enum ElementTypeGroup,values: AnalyticalLinkType (136),AngularDimensionType (37),ArcLengthDimensionType (38),AreaLoadType (82),AreaReinforcementType (87),AttachedDetailGroupType (34),BeamSystemType (54),Building...
""" Wextracto is a library for extracting data from web resources. :copyright: (c) 2012-2017 """ __version__ = '0.14.1' # pragma: no cover
""" Wextracto is a library for extracting data from web resources. :copyright: (c) 2012-2017 """ __version__ = '0.14.1'
class Solution: """ @param n: the given number @return: the double factorial of the number """ def doubleFactorial(self, n): # Write your code here result=n n=n-2 while n>0: result*=n n=n-2 return result
class Solution: """ @param n: the given number @return: the double factorial of the number """ def double_factorial(self, n): result = n n = n - 2 while n > 0: result *= n n = n - 2 return result
# -*- coding: utf-8 -*- """Initialize the bits/{{ cookiecutter.project_slug }} module.""" # This Example class can be deleted. It is just used to prove this module is setup correctly. class Example(object): """Example class.""" def __init__(self): """Initialize an Example class instance.""" p...
"""Initialize the bits/{{ cookiecutter.project_slug }} module.""" class Example(object): """Example class.""" def __init__(self): """Initialize an Example class instance.""" print('Hello world!')
def sort_tuple(l): #sorts the list based on the last element of each tuple in the list for i in range(0,len(l)): for j in range(i,len(l)): ti=l[i] tj=l[j] if(ti[len(ti)-1] >= tj[len(tj)-1]): l[i],l[j]=l[j],l[i] return l l=[] t=() element=input('Enter the element STOP to stop the set and END to stop...
def sort_tuple(l): for i in range(0, len(l)): for j in range(i, len(l)): ti = l[i] tj = l[j] if ti[len(ti) - 1] >= tj[len(tj) - 1]: (l[i], l[j]) = (l[j], l[i]) return l l = [] t = () element = input('Enter the element STOP to stop the set and END to st...
# Databricks notebook source EEPZPOYNTLXMQ JJJRZNZJQBU NWUICTFSCWRAXZCIVQH ZLMARDXCEPBVABNCRDRZXBNYUYTTVVGVUQIUGDYFCWXKACFAQQGXLA DEAMZLPRZOFVDN YKUUXXBIWLRXVGXX MVABNRSHUGM QOOHHNCXMEXVNNWMJCUQJYOJLENEEYPJGEKJQAAENEZUIWRVSZKGTVYPTTDJKBQZPHCTMMBJXEJRWMIHKWDMALPNSLGSQRRRTYB DHVRPMCZKDLIHCLAWFYKHMPZUFKVVCAQYIUAKISMVSEUVA...
EEPZPOYNTLXMQ JJJRZNZJQBU NWUICTFSCWRAXZCIVQH ZLMARDXCEPBVABNCRDRZXBNYUYTTVVGVUQIUGDYFCWXKACFAQQGXLA DEAMZLPRZOFVDN YKUUXXBIWLRXVGXX MVABNRSHUGM QOOHHNCXMEXVNNWMJCUQJYOJLENEEYPJGEKJQAAENEZUIWRVSZKGTVYPTTDJKBQZPHCTMMBJXEJRWMIHKWDMALPNSLGSQRRRTYB DHVRPMCZKDLIHCLAWFYKHMPZUFKVVCAQYIUAKISMVSEUVAFULHPQAIIGGSVWYEHYRMXYZHISJWR...
def get_digit(n): result = [] while n>0: result.insert(0,n%10) n=n//10 return result print(get_digit(12345))
def get_digit(n): result = [] while n > 0: result.insert(0, n % 10) n = n // 10 return result print(get_digit(12345))
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Part 2" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata":...
{'cells': [{'cell_type': 'markdown', 'metadata': {}, 'source': ['# Part 2']}, {'cell_type': 'code', 'execution_count': 3, 'metadata': {}, 'outputs': [], 'source': ['import pandas as pd\n', 'import numpy as np']}, {'cell_type': 'markdown', 'metadata': {}, 'source': ['# missing data']}, {'cell_type': 'code', 'execution_c...
#!/usr/bin/env python class CrossReference(object): def __init__(self, db): self.db = db def check(self, tweet): pass
class Crossreference(object): def __init__(self, db): self.db = db def check(self, tweet): pass
def check_target(ast): pass def check_iterator(ast): pass def check_lambda(ast): pass
def check_target(ast): pass def check_iterator(ast): pass def check_lambda(ast): pass
fac_no_faction = 0 fac_commoners = 1 fac_outlaws = 2 fac_neutral = 3 fac_innocents = 4 fac_merchants = 5 fac_dark_knights = 6 fac_culture_1 = 7 fac_culture_2 = 8 fac_culture_3 = 9 fac_culture_4 = 10 fac_culture_5 = 11 fac_culture_6 = 12 fac_culture_7 = 13 fac_culture_8 = 14 fac_culture_9 = 15 fac_cultur...
fac_no_faction = 0 fac_commoners = 1 fac_outlaws = 2 fac_neutral = 3 fac_innocents = 4 fac_merchants = 5 fac_dark_knights = 6 fac_culture_1 = 7 fac_culture_2 = 8 fac_culture_3 = 9 fac_culture_4 = 10 fac_culture_5 = 11 fac_culture_6 = 12 fac_culture_7 = 13 fac_culture_8 = 14 fac_culture_9 = 15 fac_culture_10 = 16 fac_cu...
n = int(input("Enter the number to be checked:")) m = (n//2)+1 c = 0 for i in range(2,m): if n%i == 0: c = 1 if c == 0: print("The number",n,"is prime") else: print("The number",n,"is not prime")
n = int(input('Enter the number to be checked:')) m = n // 2 + 1 c = 0 for i in range(2, m): if n % i == 0: c = 1 if c == 0: print('The number', n, 'is prime') else: print('The number', n, 'is not prime')
# Class # "The best material model of a cat is another, or preferably the same, cat." # # You probably won't define your own in this class, but you will have to know how to use someone else's. # # Stanley H.I. Lio # hlio@hawaii.edu # OCN318, S18, S19 # this defines a CLASS (indentation matters!): class Mordor: ...
class Mordor: pass m = mordor() class Mordor: locations = ['front yard', 'dungeon', 'driveway', 'bathroom'] def walk_into(self, v): return 'one does not simply ' + v m = mordor() for loc in m.locations: print(loc) print(m.walk_into('open the pod bay door')) print(type(m.walk_into("it doesn't h...
def test_tags_tag(self): """ Comprobacion de que la etiqueta (keyword) coincide con su asociada Returns: """ tags = Tags.objects.get(Tag="URGP") self.assertEqual(tags.get_tag(), "URGP")
def test_tags_tag(self): """ Comprobacion de que la etiqueta (keyword) coincide con su asociada Returns: """ tags = Tags.objects.get(Tag='URGP') self.assertEqual(tags.get_tag(), 'URGP')
class SenderKeyDistributionMessageAttributes(object): def __init__(self, group_id, axolotl_sender_key_distribution_message): self._group_id = group_id self._axolotl_sender_key_distribution_message = axolotl_sender_key_distribution_message def __str__(self): attrs = [] if self.gr...
class Senderkeydistributionmessageattributes(object): def __init__(self, group_id, axolotl_sender_key_distribution_message): self._group_id = group_id self._axolotl_sender_key_distribution_message = axolotl_sender_key_distribution_message def __str__(self): attrs = [] if self.g...
class Genre: def __init__(self, genre_name: str): if genre_name == "" or type(genre_name) is not str: self.name = None else: self.name = genre_name.strip() def __repr__(self): return f"<Genre {self.name}>" def __eq__(self, other: 'Genre') -> bool: r...
class Genre: def __init__(self, genre_name: str): if genre_name == '' or type(genre_name) is not str: self.name = None else: self.name = genre_name.strip() def __repr__(self): return f'<Genre {self.name}>' def __eq__(self, other: 'Genre') -> bool: r...
class frame_buffer(): def __init__(self): self.frame1 = None self.frame2 = None def set_current(self, frame): self.frame1 = self.frame2 self.frame2 = frame
class Frame_Buffer: def __init__(self): self.frame1 = None self.frame2 = None def set_current(self, frame): self.frame1 = self.frame2 self.frame2 = frame
""" Strategy Design Pattern implementation. Decorator implementation. Templates. Pattern in General. Author: Vinicius Melo """
""" Strategy Design Pattern implementation. Decorator implementation. Templates. Pattern in General. Author: Vinicius Melo """
""" 384. Longest Substring Without Repeating Characters https://www.lintcode.com/problem/longest-substring-without-repeating-characters/description 3. Longest Substring Without Repeating Characters https://leetcode.com/problems/longest-substring-without-repeating-characters/ """ class Solution: """ @param s: a...
""" 384. Longest Substring Without Repeating Characters https://www.lintcode.com/problem/longest-substring-without-repeating-characters/description 3. Longest Substring Without Repeating Characters https://leetcode.com/problems/longest-substring-without-repeating-characters/ """ class Solution: """ @param s: ...
class Hero: #private class variabel __jumlah = 0 def __init__(self,name,health,attPower,armor): self.__name = name self.__healthStandar = health self.__attPowerStandar = attPower self.__armorStandar = armor self.__level = 1 self.__exp = 0 self.__healthMax = self.__healthStandar * self.__level self...
class Hero: __jumlah = 0 def __init__(self, name, health, attPower, armor): self.__name = name self.__healthStandar = health self.__attPowerStandar = attPower self.__armorStandar = armor self.__level = 1 self.__exp = 0 self.__healthMax = self.__healthStan...
class Rectangle: def __init__(self, width, height): self.width = width self.height = height def area(self): return self.width * self.height @classmethod def new_square(cls, side_length): return cls(side_length, side_length) class num: @staticmethod def add(a, ...
class Rectangle: def __init__(self, width, height): self.width = width self.height = height def area(self): return self.width * self.height @classmethod def new_square(cls, side_length): return cls(side_length, side_length) class Num: @staticmethod def add(a,...
##################################### # Descriptions.py ##################################### # Description: # * Print run script description and # json argument descriptions to screen. def TestETLPipelineDescription(): """ * Describe TestETLPipeline and arguments. """ pass
def test_etl_pipeline_description(): """ * Describe TestETLPipeline and arguments. """ pass
a_factor = 16807 b_factor = 48271 generator_mod = 2147483647 check_mask = 0xffff def part1(a_seed, b_seed): judge = 0 a = a_seed b = b_seed for i in range(40*10**6): a = (a*a_factor) % generator_mod b = (b*b_factor) % generator_mod if a & check_mask == b & check_mask: ...
a_factor = 16807 b_factor = 48271 generator_mod = 2147483647 check_mask = 65535 def part1(a_seed, b_seed): judge = 0 a = a_seed b = b_seed for i in range(40 * 10 ** 6): a = a * a_factor % generator_mod b = b * b_factor % generator_mod if a & check_mask == b & check_mask: ...
# # PySNMP MIB module HP-SWITCH-ERROR-MSG-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-SWITCH-ERROR-MSG-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:36:45 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 ...
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_union, constraints_intersection, single_value_constraint, value_range_constraint) ...
def playeraction(action, amount, chipsleft, chipsinplay, lastraise, amounttocall): chipstotal = chipsinplay + chipsleft if action == 'fold': if chipsinplay < amounttocall: return { 'fold': True } return { 'fail': True } elif action == 'check': if chipsinplay != amounttoc...
def playeraction(action, amount, chipsleft, chipsinplay, lastraise, amounttocall): chipstotal = chipsinplay + chipsleft if action == 'fold': if chipsinplay < amounttocall: return {'fold': True} return {'fail': True} elif action == 'check': if chipsinplay != amounttocall: ...
# MIT License # # Copyright (c) 2020 Tony Wu <tony[dot]wu(at)nyu[dot]edu> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
def bulk_fetch(cur, size=100000, log=None): i = 0 rows = cur.fetchmany(size) while rows: for row in rows: i += 1 yield row if log: log.info(f'Fetched {i} rows.') rows = cur.fetchmany(size) def offset_fetch(conn, stmt, table, *, values=(), size=100...
#8-9 magic_name = ['zhoujielun','hemm','fangshiyu'] def show_magicians(name): print(name) new_magic_name = [] def make_great(name,names): for old_name in name: new_name = "the Great " + old_name new_magic_name.append(new_name) show_magicians(new_magic_name) show_magicians(names) make_great(magic_name[:],m...
magic_name = ['zhoujielun', 'hemm', 'fangshiyu'] def show_magicians(name): print(name) new_magic_name = [] def make_great(name, names): for old_name in name: new_name = 'the Great ' + old_name new_magic_name.append(new_name) show_magicians(new_magic_name) show_magicians(names) make_gre...
_base_ = ["./resnest50d_a6_AugCosyAAE_BG05_HBReal_200e_benchvise.py"] OUTPUT_DIR = "output/gdrn/hbSO/resnest50d_a6_AugCosyAAEGray_BG05_mlBCE_HBReal_200e/driller" DATASETS = dict( TRAIN=("hb_bdp_driller_train",), TEST=("hb_bdp_driller_test",), ) MODEL = dict( WEIGHTS="output/gdrn/lm_pbr/resnest50d_a6_AugC...
_base_ = ['./resnest50d_a6_AugCosyAAE_BG05_HBReal_200e_benchvise.py'] output_dir = 'output/gdrn/hbSO/resnest50d_a6_AugCosyAAEGray_BG05_mlBCE_HBReal_200e/driller' datasets = dict(TRAIN=('hb_bdp_driller_train',), TEST=('hb_bdp_driller_test',)) model = dict(WEIGHTS='output/gdrn/lm_pbr/resnest50d_a6_AugCosyAAEGray_BG05_mlB...
# -*- coding: utf-8 -*- __author__ = 'Christoph Herb' __email__ = 'ch.herb@gmx.de' __version__ = '0.1.0'
__author__ = 'Christoph Herb' __email__ = 'ch.herb@gmx.de' __version__ = '0.1.0'
game_properties = ["current_score", "high_score", "number_of_lives", "items_in_inventory", "power_ups", "ammo", "enemies_on_screen", "enemy_kills", "enemy_kill_streaks", "minutes_played", "notifications", "achievements"] print(f'{game_properties =}') print(f'{dict.fromkeys(game_properties, 0) =}')
game_properties = ['current_score', 'high_score', 'number_of_lives', 'items_in_inventory', 'power_ups', 'ammo', 'enemies_on_screen', 'enemy_kills', 'enemy_kill_streaks', 'minutes_played', 'notifications', 'achievements'] print(f'game_properties ={game_properties!r}') print(f'dict.fromkeys(game_properties, 0) ={dict.fro...
# Simply prints a message # Author: Isabella message = 'I have eaten ' + str(99) + ' burritos.' print(message)
message = 'I have eaten ' + str(99) + ' burritos.' print(message)
# # Object-Oriented Python: Dice Roller # Python Techdegree # # Created by Dulio Denis on 12/22/18. # Copyright (c) 2018 ddApps. All rights reserved. # ------------------------------------------------ # Challenge 4: Chance Scoring # ------------------------------------------------ # Challenge Task 1 of 2 # I've ...
class Yatzyscoresheet: def score_ones(self, hand): return sum(hand.ones) def _score_set(self, hand, set_size): scores = [0] for (worth, count) in hand._sets.items(): if count == set_size: scores.append(worth * set_size) return max(scores) def sc...
class ResponseHandler(): def error(self, content, title = 'Erro!'): try: resp = {'mensagem': {'titulo': title, 'conteudo': str(content)}, 'status': 'erro'} return resp except: return({'mensagem': {'titulo': 'Op...
class Responsehandler: def error(self, content, title='Erro!'): try: resp = {'mensagem': {'titulo': title, 'conteudo': str(content)}, 'status': 'erro'} return resp except: return {'mensagem': {'titulo': 'Ops', 'conteudo': 'Erro no servidor'}, 'status': 'erro'} ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "Joel Pedraza" __copyright__ = "Copyright 2014, Joel Pedraza" __license__ = "MIT" class HumbleException(Exception): """ An unspecified error occurred. """ pass
__author__ = 'Joel Pedraza' __copyright__ = 'Copyright 2014, Joel Pedraza' __license__ = 'MIT' class Humbleexception(Exception): """ An unspecified error occurred. """ pass
default_queue_name = 'arku:queue' job_key_prefix = 'arku:job:' in_progress_key_prefix = 'arku:in-progress:' result_key_prefix = 'arku:result:' retry_key_prefix = 'arku:retry:' abort_jobs_ss = 'arku:abort' # age of items in the abort_key sorted set after which they're deleted abort_job_max_age = 60 health_check_key_suff...
default_queue_name = 'arku:queue' job_key_prefix = 'arku:job:' in_progress_key_prefix = 'arku:in-progress:' result_key_prefix = 'arku:result:' retry_key_prefix = 'arku:retry:' abort_jobs_ss = 'arku:abort' abort_job_max_age = 60 health_check_key_suffix = ':health-check' keep_cronjob_progress = 60
class Scene: """ A scene has a name and a detector function, which returns true if the scene is detected, false otherwise. Attributes: name (string): A descriptive name of what the scene consists of. detector (function): A function that checks if that scene is present. """ def __init__(sel...
class Scene: """ A scene has a name and a detector function, which returns true if the scene is detected, false otherwise. Attributes: name (string): A descriptive name of what the scene consists of. detector (function): A function that checks if that scene is present. """ def __init__(self, n...
""" 387. First Unique Character in a String https://leetcode.com/problems/first-unique-character-in-a-string/ Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1. Example: s = "leetcode" return 0. s = "loveleetcode" return 2. """ # Runtime: 176ms (27.12...
""" 387. First Unique Character in a String https://leetcode.com/problems/first-unique-character-in-a-string/ Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1. Example: s = "leetcode" return 0. s = "loveleetcode" return 2. """ class Solution: def...
"""Helper functions to search class-map configurations""" def is_instance(list_or_dict) -> list: """Converts dictionary to list""" if isinstance(list_or_dict, list): make_list = list_or_dict else: make_list = [list_or_dict] return make_list def is_mpls(outter_key, inn...
"""Helper functions to search class-map configurations""" def is_instance(list_or_dict) -> list: """Converts dictionary to list""" if isinstance(list_or_dict, list): make_list = list_or_dict else: make_list = [list_or_dict] return make_list def is_mpls(outter_key, inner_key) -> None: ...
""" All settings for Riakdb module """ RIAK_1 = '192.168.33.21' RIAK_2 = '192.168.33.22' RIAK_3 = '192.168.33.23' RIAK_PORT = 8098 NUMBER_OF_NODES = 3
""" All settings for Riakdb module """ riak_1 = '192.168.33.21' riak_2 = '192.168.33.22' riak_3 = '192.168.33.23' riak_port = 8098 number_of_nodes = 3
def test_rstrip(filetab): filetab.textwidget.insert("end", 'print("hello") ') filetab.update() filetab.event_generate("<Return>") filetab.update() assert filetab.textwidget.get("1.0", "end - 1 char") == 'print("hello")\n'
def test_rstrip(filetab): filetab.textwidget.insert('end', 'print("hello") ') filetab.update() filetab.event_generate('<Return>') filetab.update() assert filetab.textwidget.get('1.0', 'end - 1 char') == 'print("hello")\n'
matrix_size = int(input()) matrix = [[int(num) for num in input().split(", ")] for _ in range(matrix_size)] primary_diagonal = [matrix[i][i] for i in range(matrix_size)] secondary_diagonal = [matrix[i][matrix_size - 1 - i] for i in range(matrix_size)] print(f"First diagonal: {', '.join([str(num) for num in primary_di...
matrix_size = int(input()) matrix = [[int(num) for num in input().split(', ')] for _ in range(matrix_size)] primary_diagonal = [matrix[i][i] for i in range(matrix_size)] secondary_diagonal = [matrix[i][matrix_size - 1 - i] for i in range(matrix_size)] print(f"First diagonal: {', '.join([str(num) for num in primary_diag...
__version__ = '0.0.2-dev' if __name__ == '__main__': print(__version__)
__version__ = '0.0.2-dev' if __name__ == '__main__': print(__version__)
# Flatten function from official compiler python module (decapriated in python 3.x) # https://hg.python.org/cpython/file/3e7f88550788/Lib/compiler/ast.py#l7 # # used to flatten a list or tupel # # [1,2[3,4],[5,[6,7]]] -> [1,2,3,4,5,6,7] def flatten(seq): l = [] for elt in seq: t = type(elt) ...
def flatten(seq): l = [] for elt in seq: t = type(elt) if t is tuple or t is list: for elt2 in flatten(elt): l.append(elt2) else: l.append(elt) return l
class Solution(object): def isValid(self, s): """ :type s: str :rtype: bool """ stack = [] dict = {'{': '}', '[': ']', '(': ')'} for x in s: if x in dict: stack.append(x) else: if not stack and stack.po...
class Solution(object): def is_valid(self, s): """ :type s: str :rtype: bool """ stack = [] dict = {'{': '}', '[': ']', '(': ')'} for x in s: if x in dict: stack.append(x) elif not stack and stack.pop() != x: ...
# It was implemented quicksort iterative due "Fatal Python error: Cannot recover from stack overflow." count = 0 # This function is same in both iterative and recursive def partition(arr,l,h): global count i = ( l - 1 ) x = arr[h] for j in range(l , h): count = count + 1 if a...
count = 0 def partition(arr, l, h): global count i = l - 1 x = arr[h] for j in range(l, h): count = count + 1 if arr[j] <= x: count = count + 1 i = i + 1 (arr[i], arr[j]) = (arr[j], arr[i]) (arr[i + 1], arr[h]) = (arr[h], arr[i + 1]) return i ...
""" Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.You may assume all four edges of the grid are all surrounded by water. Input: 11110 11010 11000 00000 Output: 1 Input: 11000 1...
""" Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.You may assume all four edges of the grid are all surrounded by water. Input: 11110 11010 11000 00000 Output: 1 Input: 11000 1...
""" propagation_params.py """ class PropagationParams(object): """Represents the parameters to set for a propagation.""" DEFAULT_CONFIG_ID = "00000000-0000-0000-0000-000000000001" DEFAULT_EXECUTOR = "STK" @classmethod def fromJsonResponse(cls, response_prop_params, description): # Ig...
""" propagation_params.py """ class Propagationparams(object): """Represents the parameters to set for a propagation.""" default_config_id = '00000000-0000-0000-0000-000000000001' default_executor = 'STK' @classmethod def from_json_response(cls, response_prop_params, description): retu...
class Solution: def permute(self, nums): res = [] self.helper(nums, res, []) return res def helper(self, nums, res, path): if not nums: res.append(path) for i in range(len(nums)): self.helper(nums[:i] + nums[i + 1:], res, path + [nums[i]]) i...
class Solution: def permute(self, nums): res = [] self.helper(nums, res, []) return res def helper(self, nums, res, path): if not nums: res.append(path) for i in range(len(nums)): self.helper(nums[:i] + nums[i + 1:], res, path + [nums[i]]) if __n...
class Auth0Exception(Exception): pass class InvalidTokenException(Auth0Exception): def __init__(self, token): self.token = token
class Auth0Exception(Exception): pass class Invalidtokenexception(Auth0Exception): def __init__(self, token): self.token = token
class Solution: def canPlaceFlowers(self, flowerbed, n): """ :type flowerbed: List[int] :type n: int :rtype: bool """ l = len(flowerbed) if n == 0: return True if l == 1: if n == 1: if flowerbed[0] == 0: ...
class Solution: def can_place_flowers(self, flowerbed, n): """ :type flowerbed: List[int] :type n: int :rtype: bool """ l = len(flowerbed) if n == 0: return True if l == 1: if n == 1: if flowerbed[0] == 0: ...
def zeros(n): def factor_count(f): sum = 0 F = f while F < n: sum += n // F F *= f return sum return min( factor_count(2), factor_count(5) )
def zeros(n): def factor_count(f): sum = 0 f = f while F < n: sum += n // F f *= f return sum return min(factor_count(2), factor_count(5))
"""Package to show distinct data structures available in Python. Data structures allow us to work with large data sets, group similar data, organize (sorting, grouping, lookups, etc.). The main Data Structure 'tools' are the following: - Lists. - Sets. - Tuples. - Dictionaries. Data S...
"""Package to show distinct data structures available in Python. Data structures allow us to work with large data sets, group similar data, organize (sorting, grouping, lookups, etc.). The main Data Structure 'tools' are the following: - Lists. - Sets. - Tuples. - Dictionaries. Data S...
"""" Question 9 : Write a program that accepts sequence of lines as input and print the lines after making all characters in the sentence capitalized.Suppose the following input supplied to the program : hello world practice makes perfect Then, output should be : HELLO WORLD PRACTICE MAKES PERFECT. ...
"""" Question 9 : Write a program that accepts sequence of lines as input and print the lines after making all characters in the sentence capitalized.Suppose the following input supplied to the program : hello world practice makes perfect Then, output should be : HELLO WORLD PRACTICE MAKES PERFECT. ...
def log(string): print(string) def debug(string): print(string)
def log(string): print(string) def debug(string): print(string)
# iterating over the keys: words = {'hello': 90, 'i': 550, 'am': 120, 'batman': 13, 'ball': 120} # for key in words.keys(): # print(key) # for key in words: # print(key) # iterate over the values # for value in words.values(): # print(value) # total_words = sum(words.values()) # print(total_words) # i...
words = {'hello': 90, 'i': 550, 'am': 120, 'batman': 13, 'ball': 120} for (key, value) in words.items(): print(key, value)