content
stringlengths
7
1.05M
class CircularQueuek: def __init__(self, k: int): self.queue = [0 for _ in range(k)] self.k = k self.front = 0 self.rear = -1 self.length = 0 def enQueue(self, value): if self.length < self.k: self.length = self.length +1 self.rear = (self...
n=(int)(input()) dict1={} dict2={} c1=0 while(n>0): n-=1 str1=(input().split(" ")) if(str1[0] not in dict1.keys()): dict1[str1[0]]=str1[1] if(str1[1] not in dict2.keys()): dict2[str1[1]]=1 else: dict2[str1[1]]+=1 c1=max(dict2.values()) for i in dict2.key...
# config files CONFIG_DIR = "config" # Link to DB Configuration DB_CONFIG_FILE = "db.yml" # Name of collection COLLECTION_NAME = 'collection_name' CONFIG_DIR = "config" CONFIG_FNAME = "rss_feeds.yml" PARAM_CONFIG_FILE = "services.yml" APP_KEYS_FILE = "keys.yml" NLU_CONFIG = "nlu_config.yml" MESSAGING_FILE = "messagin...
''' URL: https://leetcode.com/problems/build-an-array-with-stack-operations/ Difficulty: Easy Description: Build an Array With Stack Operations Given an array target and an integer n. In each iteration, you will read a number from list = {1,2,3..., n}. Build the target array using the following operations: Push: ...
#todo function to access owner and forces more easily CONNECTIONS = {'Alaska': ['Alberta', 'Northwest Territories', 'Kamchatka'], 'Northwest Territories': ['Alberta', 'Greenland', 'Ontario', 'Alaska'], 'Greenland': ['Quebec', 'Northwest Territories', 'Ontario', 'Iceland'], ...
#!/usr/bin/python # Copyright 2017 Mirantis, Inc. # # 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 a...
# There's a function blackbox(lst) that takes a list, does some magic, and returns a list. # You don't know if it modifies the given list or creates a completely different one. # Find this out testing the function on your own list and print "modifies" if the fu # blackbox(lst) # print("modifies") # if the function ch...
# Path to the root location of the application inside the container. APP_ROOT = '/intend4' # Configuration directory, inside the application CONFIG_DIR = "{}/config".format(APP_ROOT) # Logging level LOG_LEVEL = 'INFO' # CRITICAL / ERROR / WARNING / INFO / DEBUG
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: # @return a ListNode def removeNthFromEnd(self, head, n): if head is None: return None nodes = [] p = head while p : ...
# # Automatically generated # class Asm6502(object): pass Asm6502.BRK = 0x00 Asm6502.ORA_IX = 0x01 Asm6502.ORA_Z = 0x05 Asm6502.ASL_Z = 0x06 Asm6502.PHP = 0x08 Asm6502.ORA_IM = 0x09 Asm6502.ASL = 0x0A Asm6502.ORA_A = 0x0D Asm6502.ASL_A = 0x0E Asm6502.BPL = 0x10 ...
class WindowPosition: position = [] def get(self, quantity, pos_x, pos_y, width, height): if quantity == 1: self.position.append({'pos_x': pos_x, 'pos_y': pos_y, 'width': width, 'height': height}) else: height_ratio = height * 4 / 3 # TODO hard coded 4:3 ratio ...
#! python3 # __author__ = "YangJiaHao" # date: 2018/12/25 def duplicate(nums): length = len(nums) for n in nums: if n < 0 or n >= length: return False for i in range(len(nums)): while nums[i] != i: if nums[i] == nums[nums[i]]: return nums[i] ...
#!/usr/bin/env python3 PIKS_DEFAULT_DIR=".piks" PIKS_DEFAULT_FILE="piks.db" PIKS_DEFAULT_CHECKSUM="sha512" if __name__ == "__main__": pass
categories = { 'Network Stereo Zone Amplifier', 'Network Stereo Receiver', 'Portable Player', 'Media Player', 'Network Streamer', 'Network player & Preamplifier', 'CD Player', 'Speaker', 'DAC', 'CD player', 'Streaming DAC', 'DAC & Network Streamer', 'DAC & Headphone Amp', 'Network Audio & CD...
#return True if sum of any two num in list equals key O(n) num=[] n=int(input()) for x in range(n): num.append(int(input())) key=int(input()) for x in range(n): if key-num[x] in num: print(True) exit() #quit() print(None)
class Order(): ASCENDING = 0 # lower is better DESCENDING = 1 # higher is better class Format(): ANONYMOUS = 0b0001 NAMED = 0b0010 LEADERBOARD = 0b0100 LIST = 0b1000 Delim = '|' KeyScorePosition = -1 # indeks v rezultatu, po katerem sortiramo ExpectedNicknamePosition = 10000 # indeks nickn...
"""Holodeck Exceptions""" class HolodeckException(Exception): """Base class for a generic exception in Holodeck.""" class HolodeckConfigurationException(HolodeckException): """The user provided an invalid configuration for Holodeck""" class TimeoutException(HolodeckException): """Exception raised when...
n = int(input()) triangleList = [] for i in range(n): temp = [] if i == 0: temp.append(1) else: for j in range(i+1): if j==0 or j==i: temp.append(triangleList[i-1][j-1]) else: temp.append(triangleList[i-1][j]+triangleList[i-1...
#visibilidade public, protect and private class caneta: def __init__(self): self.cor = 'Eu sou público' self._tinta = 'Eu sou protegido' self.__tampa = 'Eu sou privado' obj = caneta() print(obj.cor) print(obj._tinta) print(obj.__tampa)
""" Constants used in project. """ class VersionParts: """ Utility class with constants for version parts. """ ALPHA = "alpha" BETA = "beta" RC = "rc" PRE = "pre" POST = "post" DEV = "dev" MAJOR = "major" MINOR = "minor" MICRO = "micro" LOCAL = "local" EPOCH = ...
# Copyright (c) 2020 The DAML Authors. All rights reserved. # SPDX-License-Identifier: Apache-2.0 lf_stable_version = "1.6" lf_latest_version = "1.7" lf_dev_version = "1.dev" lf_versions = [lf_stable_version, lf_latest_version, lf_dev_version]
class PluginBase(object): def run(self, **kwargs): err = "Error, this is an abstract method " \ "you need implement this in a derived class" raise NotImplementedError(err) class PluginDescription(object): def __init__(self, name, author, ...
# -*- coding: utf-8 -*- config = dict( age_config={ "feature_name": "age", "feature_data_type": "int", "default_value": "PositiveSignedTypeDefault", "json_path_list": [("age", "$..content.age", "f_assert_not_null->f_assert_must_digit_or_float")], "f_map_and_filter_chain": "m_...
# # @lc app=leetcode id=309 lang=python3 # # [309] Best Time to Buy and Sell Stock with Cooldown # # @lc code=start class Solution: def maxProfit(self, prices: List[int]) -> int: if len(prices) < 2: return 0 s0 = 0 s1 = -prices[0] s2 = float('-inf') for i in rang...
class ArgumentsMethods(object): def add_arguments(self, parser): parser.add_argument( "states", nargs="+", help="States to export by FIPS code." )
# Programa recebe uma lista e transforma em uma strng separada por ',' e and antecedendo o ultimo elemento. def concatenar(lista): temporario = '' index = 0 for item in lista: if index == len(lista)-1: temporario += f'and {item}.' else: temporario += f'{item}, ' ...
MESSAGES = dict({ "1": "\n\nData provided for method __init__() of class Feature \n" "was not correct to create dict() object", "2": "\n\nFeature object is not a valid geojson feature object, \n" "one of the following failed, geometry, properties or type field are missing \n", "3": "\n\nCo...
bidi_dir = 'ltr' ######################################################################### # scrapbook.cache ######################################################################### # map.html cache_index_toggle_all = 'Toggle all' cache_index_search_link_title = 'Search' cache_index_source_link_title = 'Source link...
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'leftTYPECASTrightUMINUSrightUNOTleftMASMENOSleftPOTENCIAleftPORDIVRESIDUOleftANDORSIMBOLOOR2SIMBOLOORSIMBOLOAND2leftDESPLAZAMIENTOIZQUIERDADESPLAZAMIENTODERECHAABS ACOS...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class PyLabours(PythonPackage): """Python module dependency visualization.""" homepage = "https://github.com/src...
"""Deployment rules """ load("//tools:providers.bzl", "DeploymentZoneInfo") def _deployment_zone_impl(ctx): if len(ctx.attr.account_id) != 12: fail("AWS Account IDs are 12 characters long") return [ DeploymentZoneInfo( account_id = ctx.attr.account_id, deployment_role =...
class GroupHelper: def __init__(self, app): self.app = app def open_group_page(self): wd = self.app.wd wd.find_element_by_link_text("Групи").click() def create(self, Group): wd = self.app.wd wd.find_element_by_name("new").click() wd....
def read(filename): with open(filename, "r") as file: lines = file.readlines() result = {} mode = "main" result[mode] = {} for i in lines: i = i.replace("\n", "") if i.startswith(" "): i = i[4:] if i.startswith(" "): i ...
"""Interop with Java.""" load("@bazel_skylib//lib:collections.bzl", "collections") JavaInteropInfo = provider( doc = "Information needed for interop with Java rules.", fields = { "inputs": "Files needed during build.", "env": "Dict with env variables that should be set during build.", }, )...
# @author:leacoder # @des: 染色法 + DFS 岛屿的个数 class Solution: # 便于 上下左右扩散 dx = [-1, 1, 0, 0] dy = [ 0, 0,-1, 1] def numIslands(self, grid: List[List[str]]) -> int: if not grid or not grid[0]: return 0 # 参数判断 self.max_x = len(grid) # 边界 self.max_y = len(grid[0]) # ...
class StudentView: def __dispaly_menu(self): print("按1键录入学生信息") print("按2键显示学生信息") print("按3键删除学生信息") print("按4键修改学生信息") def __select_menu(self): item=input("请输入选项:") if item=="1": self.__input_student() def __input_student(self): pass
description = '' pages = ['header'] def setup(data): pass def test(data): navigate('http://store.demoqa.com/') click(header.my_account) verify_text('You must be logged in to use this page. Please use the form below to login to your account.') def teardown(data): pass
# Two City Scheduling # There are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i][0], and the cost of flying the i-th person to city B is costs[i][1]. # A function to return the minimum cost to fly every person to a city such that exactly N people arrive in each ci...
mystr = "banana" for x in mystr: print(x)
FETCH_DATA_SOURCES_SQL = "select description, downloaded, url, data_source_type, group_name " \ "from data_source " \ "order by downloaded, group_name, description;" class DataSourcesQueryNames(object): DESCRIPTION = 'description' DOWNLOADED = 'downloaded' ...
geral = {} aproveitamento = list() geral['nome'] = str(input('Nome jogador: ')) partidas = int(input(f'Quantas partidas {geral["nome"]} jogou ?')) count = 0 total = 0 while count < partidas: gols_games = (int(input(f'Quantos gols na partida {count}?'))) aproveitamento.append(gols_games) total = total + gol...
# Exports __all__ = ( "CommandFailed", "InputError", "OutputError", "ResourceUnavailable", ) # Classes class CommandFailed(Exception): """Occurs when a library function or method fails to successfully run a :py:class:`shell.Command`.""" pass class InputError(Exception): """Occurs when ...
class Pessoa: __match_args__ = ('nome','idade','funcionario') def __init__(self, nome, idade, funcionario=False) -> None: self.nome: nome self.idade: idade self.funcionario= funcionario def __repr__(self) -> str: return self.nome def valor_cinema(pessoas:list[...
#!/usr/bin/env python # Exercicio 3.1 - Complete a tabela a seguir, marcando inteiro ou ponto flutuante dependendo do número apresentado. print (' ') print ('Os Numeros são 5, 5.0, 4.3, -2, 100, 1.333') print ('Quais destes números são ponto flutuante "No livro existe uma tabale para preencher, farei diretamente aqu...
# Crie um programa que leia um numero inteiro e mostre na tela se ele é par ou impar. numero = int(input('Informe um número qualquer: ')) if numero == 0 or numero % 2 == 0: print(f'O número {numero} digitado é par.') else: print(f'O número {numero} digitado é impar.')
INTEGER = "int" FLOAT = "float" BOOLEAN = "bool" STRING = "str" EMAIL = "email" ALPHA = "alpha" ALPHANUMERIC = "alphanumeric" STD = "std" LIST = "list" DICT = "dict" FILE = "file" ALLOWED_TYPES = {INTEGER: {"type": "integer"}, FLOAT: {"type": "number"}, BOOLEAN: {"type": "boolean"}, STRING: {"type": "string"}, ...
# Change colours here --> format as (colour, colour on opposite side) pairs = (("white","yellow"), ("yellow","white"), ("red","orange"), ("orange","red"), ("green","blue"), ("blue","green")) # Make sure there are 6 logically valid pairs class Piece: def __init...
APP_ID_TO_ARN_IDS = { 'co.justyo.yoapp': [ 'ios', 'ios-beta', 'ios-development', 'android', 'winphone' ], 'co.justyo.yopolls': [ 'com.flashpolls.beta.dev', 'com.flashpolls.beta.prod', 'com.flashpolls.flashpolls.dev', 'com.flashpolls....
class ObjectSerializer(object): """ The object serializer is responsible for converting objects to and from basic data types. Basic data types are serializable to and from most common data representation languages (such as yaml or json) Basic data types are: - str (basestring in Python2, str i...
############### BOT BILGILERI ############### token = "NzgzNDI2OTcwOTE0MzkwMDY4.X8alOQ.gjPYhoth4OUp5oZVhSXizPcwG0c" prefix = ['!!'] sahip_id = 735555273644703915 ############### VERI TABANI BILGILERI ############### db_host = 'localhost' db_user = 'root' db_password = '' db_name = 'url_hunter' db_charset = 'utf8mb4'...
#!/usr/bin/python zoo = ('python', 'elephant', 'penguin') # remember the parentheses are optional print('Number of animals in the zoo is', len(zoo)) new_zoo = ('monkey', 'camel', zoo) print('Number of cages in the zoo is', len(new_zoo)) print('All animals in new zoo are', new_zoo) print('Animals brought from old zoo...
def interest_template(isPlain, user_id, sim_percent): percent = int(sim_percent * 100) if isPlain: text = "Connect with {{user-%d}} as you have %d%% interests in common" \ % (user_id, percent) else: text = "<orange>Connect with {{user-%d}}</orange> as you have %d%% interests in common" \ % (user_id, p...
############################################################################## # Parte do livro Introdução à Programação com Python # Autor: Nilo Ney Coutinho Menezes # Editora Novatec (c) 2010-2020 # Primeira edição - Novembro/2010 - ISBN 978-85-7522-250-8 # Segunda edição - Junho/2014 - ISBN 978-85-7522-408-3 # Terce...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Helper functions for configuring scraper URLs. """ def house_url(path): """ Joins relative house url paths with stem or returns url if stem present. :param path: String path to format. :return: Full house URL. """ stem = "https://house.mo.gov" ...
# Implementation of Binary Search # print('hello world') print(' ') # Define the Binary search variables # def binary_Search(array, start, end, x): if end >= start: # Alot the mid value # mid = (start + end) // 2 if array[mid] == x: # Array pointer equal to mid value # return mi...
with open('1X-PBS_CurrentVsTime_10000sWait_Still.csv', 'r') as f: f.readline() f.readline() lastVoltage = 0.0 line = f.readline() o = None while line: splits = line.split(',') voltage = float(splits[1]) if voltage != lastVoltage: if o is not None: ...
#ToDo remove version found in wp1 parser def create_chr_mapper(mapper_file, chr_to_nc=True): """ First and second column of input file should be of the following format: First column: chr1 Second column: NC_000001.10 :param file: path to input file :return dict= {'N...
length = int(input()) width = int(input()) height = int(input()) number = float(input()) volume = length * width * height total_liters = volume * 0.001 percent = number * 0.01 result = total_liters * (1 - percent) print('{0:.3f}'.format(result))
class HandshakeRequestMessage(object): def __init__(self, protocol, version): self.protocol = protocol self.version = version
"""Interface defines required methods for an action class""" class ActionInterface: def execute(self): """Primary method of any action is to execute the code required to fulfil the action""" pass
a, b, c = input().split(' ') a = int(a) b = int(b) c = int(c) MaiorAB = (a + b + abs(a - b)) / 2 MaiorABC = (MaiorAB + c + abs(MaiorAB - c)) / 2 print(f'{MaiorABC:.0f} eh o maior')
"""Package init.""" __author__ = """Ivan Savchenko""" __email__ = 'iam.savchenko@gmail.com' __version__ = '0.2.0'
""" 15663 : N과 M (9) URL : https://www.acmicpc.net/problem/15663 Input #1 : 3 1 4 4 2 Output #1 : 2 4 Input #2 : 4 2 9 7 9 1 Output #2 : 1 7 1 9 7 1 7 9 9 1 9 7 9 9 Input #3 : 4 4 ...
def while_loop(): cycle = 1 print('While loop: ') while cycle < 6: print('Inside a loop -> cycle : ', cycle) cycle = cycle + 1 print('Done - cycle =', cycle) def multiplication_table(): print(' -------------------- ') print('Multiplication table: ') number = 1; count = 1 ...
class Solution: def lengthOfLongestSubstring(self, s: str) -> int: # simplest case if len(s) == 0: return 0 longestSubstr = "" tempLongest = "" for i in range(0, len(s)): currentChar = s[i] tempLongest = self.getFirstNonrepeatingSubstr(s[i:]) ...
#python3 code def solution(x, y): # Your code here res = ((x+y-1)*(x+y-2))/2 + x return str(res)
"""Top-level package for pytolanalyst.""" __author__ = """Rob Siegwart""" __email__ = 'rob@robsiegwart.com' __version__ = '0.1.0'
class GameState(object): def __init__(self, boxes, worker, parent): self.boxes = boxes self.worker = worker self.parent = parent def __eq__(self, other): return self.boxes == other.boxes and self.worker == other.worker def __hash__(self): return hash( (self.worker,...
def parse_adjustment(data): return parse_adjustment_data(data['$objects'], data['$top']['root'].data) def parse_adjustment_data(data, root_index): out = {} for idx, key in enumerate(data[root_index]['NS.keys']): objkey = data[key.data] keyval = data[root_index]['NS.objects'][idx].data ...
def binaryTreePaths(root: Optional[TreeNode]) -> List[str]: paths = [] if not root: return paths if (not root.right) and (not root.left): # This is a leaf paths.append(str(root.val)) if root.right: # append result of subtree on right paths.extend([f"{root.val}->{s...
class InnerClass: def __init__(self, a, b, c): self.a = a self.b = b self.c = c def generate_stuff(self): return self.a+10*self.b+100*self.c
def for_pentagon(): for row in range(10): for col in range(9): if (row==9) or (row>4 and (col==0 or col==8)) or (row+col==4 or col-row==4): print("*",end=" ") else: print(end=" ") print() def while_pentagon(): row=0 while r...
""" -------------------------------------------------------------------------------- Description: Generates a statistical report for genetic circuit scoring Written by W.R. Jackson, Ben Bremer, Eric South -------------------------------------------------------------------------------- """
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None def __repr__(self): return "{}".format(self.val) class Solution(object): # @param root, a tree node # @return a boolean # Time: N ...
#https://www.hackerearth.com/practice/basic-programming/input-output/basics-of-input-output/practice-problems/algorithm/two-strings-4/ entry = int(input()) for i in range(entry): string1, string2 = input().split() for c in string1: if c in string2: string1 = string1.replace(c, '', 1) string2 = stri...
#a1q2c.py #HUGHXIE #input for color and time from light color = input("What color is the light? (G/Y/R) :") speed = float(input("Enter speed of car in m/s: ")) distance = float(input("Enter distance from light in meters: ")) time = (distance / speed) #checks if color is red and time is greater than 2 or color is yell...
def without_end(str): if len(str) == 2: return '' else: str = str[1:] l = len(str) -1 str = str[:l] return str
inFile = open("/etc/php5/fpm/pool.d/www.conf", "r", encoding = "utf-8") string = inFile.read() string = string.replace("pm.max_children = 5", "pm.max_children = 100") inFile.close() out = open("/etc/php5/fpm/pool.d/www.conf", "w", encoding = "utf-8") out.write(string) out.close()
""" This file contains the implementation of functions that are not represented as a single node in the computational graph, but are treated as a **compound** function. Note ---- These functions should be replaced by a dedicated implementation in * algopy.Function * algopy.UTPM so they are represented by a single n...
class Calculator(): def __init__(self, number_1, number_2): self.number_1 = number_1 self.number_2 = number_2 def add(self): return self.number_1 + self.number_2 def subtract(self): return self.number_1 - self.number_2 def multiply(self): return self.number_1 ...
# Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. """ Functions that handle co...
happy_nums = set() happy_nums.add(1) class Solution: def sqrSum(self, n: int) -> int: res = 0 for c in str(n): res += int(c)**2 return res def isHappy(self, n: int) -> bool: global happy_nums temp = set() while True: sqr = self.sqrSum(n...
def swap(lst): if len(lst) < 2: return lst first = lst[0] last = lst[-1] return [last] + lst[1:-1] + [first] print(swap([12, 35, 9, 56, 24])) print(swap([1, 2, 3]))
a, b, c = input().split(" ") a = int(a) b = int(b) c = int(c) if (c < a + b) and (b < c + a) and (a < b + c) and (0 < a,b,c < 10**5): if((a != b and b == c) or ( a == c and a != b) or ( a == b and c != b)): print("Valido-Isoceles") if ((a**2 == b**2 + c**2) or (b**2 == a**2 + c**2) or (c**2 == b**2...
def main(): f = [line.rstrip("\n") for line in open("Data.txt")] coordinates = [] for line in f: coordinate = [int(i) for i in line.split(", ")] coordinates.append(coordinate) count = 0 for i in range(400): for j in range(400): sum_ = 0 for coordinat...
class Solution: def mostCommonWord(self, paragraph: str, banned) -> str: helper = {} tmp_word = "" for i in paragraph: if (ord('a') <= ord(i) <= ord('z') or ord('A') <= ord(i) <= ord('Z')) is False: if len(tmp_word) > 0: if helper.__contains__(...
#!python # -*- coding: utf-8 -*- # @author: Kun ''' Author: Kun Date: 2021-09-30 00:48:14 LastEditTime: 2021-09-30 00:48:14 LastEditors: Kun Description: FilePath: /HomoglyphAttacksDetector/utils/__init__.py '''
{ 'includes':[ '../common/common.gypi', ], 'targets': [ { 'target_name': 'tizen_network_bearer_selection', 'type': 'loadable_module', 'sources': [ 'network_bearer_selection_api.js', 'network_bearer_selection_connection_mobile.cc', 'network_bearer_selection_connect...
# Resolve the problem!! PALINDROMES = [ 'Acaso hubo buhos aca', 'A la catalana banal atacala', 'Amar da drama', ] NOT_PALINDROMES = [ 'Hola como estas', 'Platzi' 'Oscar', ] def is_palindrome(palindrome): """ validates that the string palindrome is a palindrome (it is a word or p...
def DEBUG(s): #pass print(s)
def print_n(s, n): """write a function that prints a string n times""" while n > 0: print(s) n = n - 1 print_n('string', 3)
def add_to(subparsers): parser = subparsers.add_parser( "wifi", help="Get and set WiFi configuration", ) parser.add_children(__name__, __path__)
''' 1. Write a Python program to print the following string in a specific format (see the output). Go to the editor Sample String : "Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what you are" ...
''' Fill in your credentials from Twitter ''' consumer_key = '' consumer_secret = '' access_token_key = '' access_token_secret = '' account_name = "@" kytten_name = "" #Screen Name without the "@"
"""Contain constants Ids and labels.""" # pylint: disable=R0903 class DataSourceType: """Data source type Ids.""" CLOUDERA_HIVE_ID = 1 CLOUDERA_IMPALA_ID = 2 MARIADB_ID = 3 MSSQL_ID = 4 MYSQL_ID = 5 ORACLE_ID = 6 POSTGRESQL_ID = 7 SQLITE_ID = 8 TERADATA_ID = 9 SNOWFLAKE_ID...
class Solution: def longestRepeatingSubstring(self, S: str) -> int: # dp[i][j] means the longest repeating string ends at i and j. # (aka the target ends at i and the repeating one ends at j) n = len(S) + 1 dp = [[0] * n for _ in range(n)] result = 0 for i in range(1...
emojis = \ { 29000000: "<:Unranked:601618883853680653>", 29000001: "<:BronzeLeagueIII:601611929311510528>", 29000002: "<:BronzeLeagueII:601611942850986014>", 29000003: "<:BronzeLeagueI:601611950228635648>", 29000004: "<:SilverLeagueIII:601611958067920906>", 29000005: ...
course = 'Python for Beginners' #print the length of the string print(len(course)) #print all in upper print(course.upper()) #print all in lower print(course.lower()) #Find index of the first instance of 'P' print(course.find('P')) #Find index of the first instance of 'o' print(course.find('o')) #Find index of th...
# -*—coding=utf_8-*— # @Time :14:47 # @Author :Jonah # @File :main ().py # @Software :PyCharm print("hello")
#4.2 list_with_integers = [26, 3, 22, 5.9, 1337, 988, 69.544] for i in list_with_integers: print(float(i))