content
stringlengths
7
1.05M
print("Look at the assinment statements") #1. Set a variable called playerlives equal to 3 playerlives = 3 #Write assignment statements for 2 to 6 below #2. set a variable called chocolate equal to 2 #3. set a variable called scorevalue equal to 4 #4. set a variable called totalscore equal to scorevalue * 3 #5. set...
palavra = input('Informe uma palavra: ') print('palavra invertida: ', palavra[::-1]) for letra in palavra: print(letra)
"""Non-public internal utilities used across the library. The classes and functions under this module are not meant to be touched by users. """ __all__ = ()
dy_import_module_symbols("testchunk_helper") SERVER_IP = getmyip() SERVER_PORT = 60606 DATA_RECV = 1024 CHUNK_SIZE_SEND = 2**9 # 512KB chunk size CHUNK_SIZE_RECV = 2**9 DATA_TO_SEND = "Hello" # 5Bytes of data launch_test()
''' pretrained model for StarGAN details adding soon ! '''
# # Copyright 2021 Abir Haque # Subject to MIT License in LICENSE file # # # # Perfect Square Roots: # # Find the square root of any given perfect square without multiplication or division. # # This is possible as all perfect squares are the sum of odd integers [1]. # This arithmetic sequence can be seen below: # # ...
""" A module that displays a poor-man's bar chart. """ def render_chart(word_list): """ Renders a bar chart to the console. Each row of the chart contains the frequency of each letter in the word list. Returns: A dictionary whose keys are the letters and values are the fre...
#!/usr/bin/env python # -*- coding: utf-8 -*- """unshurl - Author: Daniel J. Umpierrez - Created: 26-05-2019 - License: UNLICENSE - Github: https://github.com/havocesp/unshurl """ __version__ = '0.1.0' __site__ = 'https://github.com/havocesp/unshurl' __license__ = 'UNLICENSE' __author__ = 'Daniel...
# For Keystone Engine. AUTO-GENERATED FILE, DO NOT EDIT [keystone_const.py] KS_API_MAJOR = 0 KS_API_MINOR = 9 KS_VERSION_MAJOR = 0 KS_VERSION_MINOR = 9 KS_VERSION_EXTRA = 1 KS_ARCH_ARM = 1 KS_ARCH_ARM64 = 2 KS_ARCH_MIPS = 3 KS_ARCH_X86 = 4 KS_ARCH_PPC = 5 KS_ARCH_SPARC = 6 KS_ARCH_SYSTEMZ = 7 KS_ARCH_HEXAGON = 8 KS_ARC...
class TestDataError(Exception): pass class MissingElementAmountValue(TestDataError): pass class FactoryStartedAlready(TestDataError): pass class NoSuchDatatype(TestDataError): pass class InvalidFieldType(TestDataError): pass class MissingRequiredFields(TestDataError): pass class UnmetDependentFi...
# -*- coding: utf-8 -*- def test_help_message(testdir): result = testdir.runpytest( '--help', ) # fnmatch_lines does an assertion internally result.stdout.fnmatch_lines([ 'helm:', '*--helm-path=HELM_PATH*', ]) def test_helm_path_ini_setting(testdir): testdir.makeini("...
# ******Numbers with The Highest Amount of Divisors****** # codewars # An array of different positive integers is given. We should create a code that gives us the number (or the numbers) that has (or have) the highest number of divisors among other data. # The function proc_arrInt(), (Javascript: procArrInt()) will ...
# # PySNMP MIB module EDB-snmp (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EDB-snmp # Produced by pysmi-0.3.4 at Wed May 1 12:59:23 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:1...
n1 = float(input()) n2 = float(input()) meida = ((n1*3.5)+(n2*7.5))/(3.5+7.5) print(f"MEDIA = {meida:.5f}")
''' 数组中查找和为target的所有组合方式 ''' res = [] def find_sort(nums, target, tmp): l = len(nums) if l == 1: if nums[0] == target: lis = sorted(nums + tmp) if lis not in res: res.append(lis) return for i in range(l): if nums[i] > target: ...
# Rotate Image ''' You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation. Example 1: Input: matrix = [[1,2,3],[...
# -*- coding: utf-8 -*- def sort_by_counting(array: list) -> list: """ Сортировка подсчетом. Суть: на каждом шаге подсчитывается в какую позицию результирующего массива result необходимо записать очередной элемент исходного массива array. * Сохраняет порядок элементов с одинаковыми значениями ...
class Solution: def lengthOfLongestSubstring(self, s: str) -> int: if len(s) == 0: return 0 current_length = 0 max_length = 0 idx = 0 last_dup_index = -1 count = {} while idx < len(s): if s[idx] not in count or count[s[idx]] < last_dup...
produto = float(input("Digite o valor do produto: R$")) d = produto - produto * 0.05 print("O valor do produto é {:.2f}, mas com desconto de 5% fica {:.2f}".format(produto, d)) #valor * porcentagem / 100 (d = produto - produto * 5 /100)
class move_avg: def __init__(self, bufmax): self.buf = [] self.bufmax = bufmax def add(self, val): self.buf.append(val) if len(self.buf) > self.bufmax: del self.buf[0] def get(self): if len(self.buf) > 0: avg = sum(self.buf)/len(self.buf) else: avg = 0 return avg
# coding: UTF-8 print(r''' 【程序41】题目:海滩上有一堆桃子,五只猴子来分。第一只猴子把这堆桃子凭据分为五份,多了一个,这只猴子把多的一个扔入海中,拿走了一份。第二只猴子把剩下的桃子又平均分成五份,又多了一个,它同样把多的一个扔入海中,拿走了一份,第三、第四、第五只猴子都是这样做的,问海滩上原来最少有多少个桃子? ''')
"""уровень 1""" # pylint: disable=R0903 class User: """класс User"""
# -*- coding: utf-8 -*- """ Standard values for CoastalVarExtractor. They should not need to be changed except to include more site value mappings. They do not require any input values. """ sitemap = { 'Assawoman':{'region': 'Delmarva', 'site': 'Assawoman', 'code': 'assa', 'M...
# -*- coding: utf-8; -*- class ConsulSSLError(Exception): """ Error raised when https is defined in --host argument or environmental variable and ssl certificates are not configured or defined """ def __init__(self, msg): self.msg = "https scheme defined without any ssl certificates pr...
TEMPLATES = { "multilingual-record-dumper": "templates/invenio_record_dumper_multilingual.py.jinja2", "record-multilingual": "templates/invenio_record_multilingual.py.jinja2", "subschema-multilingual": "templates/invenio_schema_multilingual.py.jinja2", "multi-search": "templates/invenio_record_search_mu...
# Getting input and converting to int student_heights = input("Input a list of student heights ").split() for n in range(0, len(student_heights)): student_heights[n] = int(student_heights[n]) # Varibales to store sum and total and count sum_of_heights = 0 total_height = 0 count_of_students = 0 # This is to f...
N, X = input().split() A = list(map(int, input().split())) B = [] for i in range(0, int(N)) : if(A[i] < int(X)) : print(A[i], end=" ")
''' A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers representing the size of these parts. ''' class Solution: def partitionLabels(self, S): """ :type S: str ...
def main(): print("Welcome to the casino!") print("Rules are simple, guess a number, if you get it right you win 100000 dollars~") print("Else you loose 5 dollars") while True: try: number = int(input("Choose a number: ")) except ValueError: print("INVALID NU...
# -*- coding: utf-8 -*- class Config(object): """Configure me so examples work Use me like this: mysql.connector.Connect(**Config.dbinfo()) """ HOST = 'localhost' DATABASE = 'test' USER = '' PASSWORD = '' PORT = 3306 CHARSET = 'utf8' UNICODE = True ...
class VectorIndex: @property def files(self): return [] def save(self): pass def load(self): pass def build(self): pass def search(self): pass def search_index(self): pass def add(self, vector): pass def add_bulk(self, vectors): pass def set_bulk(self, indices...
d = int(input('Por quantos dias o carro foi alugado? ')) k = float(input('Quantos km foram rodados? ')) v = 60 * d + 0.15 * k print('O valor a ser pago é' , v)
class CallbackSettings(object): @property def JAVASCRIPT(self): return super().JAVASCRIPT + ( 'callback/modal.js', ) @property def INSTALLED_APPS(self): apps = super().INSTALLED_APPS + [ 'callback' ] if not 'captcha' in apps: ...
#Duplicates of ReadyResult constants - keeps this class clean of imported modules leaking into the sandbox NOT_READY = 'NotReady' READY = 'Ready' FAILED = 'Failed' class ReadyResultHolder: def __init__(self): self.__readiness = READY self.__reason = None def ready(self): self.__readi...
############################################################################## # Copyright (c) 2017 ZTE Corp # feng.xiaowei@zte.com.cn # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is ...
n = int(input()) pieces = {} for _ in range(n): piece, composer, key = input().split('|') pieces[piece] = [composer, key] while True: line = input() if line == 'Stop': break args = line.split('|') command = args[0] piece = args[1] if command == 'Add': ...
def map_llc_result_to_dictionary_list(land_charge_result): """Produce a list of jsonable dictionaries of an alchemy result set """ if not isinstance(land_charge_result, list): return list(map(lambda land_charge: land_charge.to_dict(), [land_charge_result])) else: ...
DEBUG = True PLUGINS = ["fastack_sqlmodel", "fastack_migrate"] COMMANDS = [] DB_USER = "fastack_user" DB_PASSWORD = "fastack_pass" DB_HOST = "db" DB_PORT = 5432 DB_NAME = "fastack_db" SQLALCHEMY_DATABASE_URI = ( f"postgresql+psycopg2://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}" ) SQLALCHEMY_OPTIONS = {}...
""" 1. Clarification 2. Possible solutions - Binary search I - Binary search II - Binary search III 3. Coding 4. Tests """ # T=O(lgn), S=O(1) class Solution: def search(self, nums: List[int], target: int) -> int: if not nums: return -1 left, right = 0, len(nums) - 1 while left ...
a = input() p = input() if p in a + '*': print("S") else: print("N")
''' All python scripts are modules and collection modules are package pip is used to install packages ''' def Demo(): a = int(input('Enter a 1st number')) b = int(input('Enter 2nd number')) s = 0 s = a + b return s print(Demo()) print("I will run") print(f'{__name__}') def Solve...
# https://www.python-course.eu/graphs_python.php class Graph(object): def __init__(self, vertices): """ initializes a complete graph object """ graph_dict = {} for node in vertices: graph_dict[node] = [] for vertex in vertices: if node != vertex: ...
#!/usr/bin/env python3 def solution(array): """ Returns the maximal sum of a double slice. Double Slice is a triplet (X, Y, Z), such that 0 ≤ X < Y < Z < N and its sum is the sum of the elements between array[X+1] and array[Z-1] minus array[Y] """ n = len(array) max_ending = [0] * n max_starting = [...
WALL = '#' PASSABLE = '.' class SquareGrid: def __init__(self, width, height): self.width = width self.height = height self.walls = set() def in_bounds(self, id): (x, y) = id return 0 <= x < self.width and 0 <= y < self.height def cost(self, from_node, to_node): ...
s = "" for x in range(33,127): # <33; 126> s += chr(x) print(s)
# split join enumerate # string = 'Uma frase qualquer, uma frase bem bonita!' # lista = string.split(' ') # lista2 = string.split(',') # string2 = '-'.join(lista) lista = ['João', 'Pedro', 'Maria'] # for indice, valor in enumerate(lista): # print(indice, valor) #enumerate faz isso lista = [ [0,'João'], ...
class RadioButtonFsm: def __init__(self, title, position, command=None): self.title = title self.command = command self.position = position
# Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. # # An input string is valid if: # # Open brackets must be closed by the same type of brackets. # Open brackets must be closed in the correct order. # Note that an empty string is also considered val...
def calculadora(num1, num2): operacao = input("Digite o sinal da operação desejada ( + - * / ): " ) if operacao == "+": return num1 + num2 elif operacao == "-": return num1 - num2 elif operacao == "*": return num1 * num2 elif operacao == "/": return num1 / num...
price = 24 item = 'banana' print('The %s costs %d cents.' % (item, price)) print('The %+10s costs %5.2f cents.' % (item, price)) print('The %+10s costs %10.2f cents.' % (item, price)) itemdict = {'item': 'banana', 'cost': 24} print('The %(item)s costs %(cost)7.1f cents.' % itemdict) """ The banana costs 24 cents. Th...
# Scrapy settings for tutorial project # # For simplicity, this file contains only the most important settings by # default. All the other settings are documented here: # # http://doc.scrapy.org/topics/settings.html # BOT_NAME = 'tutorial' SPIDER_MODULES = ['tutorial.spiders'] NEWSPIDER_MODULE = 'tutorial.spiders...
""" 问题描述:构造一个特殊的栈,要求 1)使之pop()、push()和getMin() (求最小值) 的操作的时间复杂度都为O(1) 2)可以使用现成的栈类型 思路:使用两个栈,一个栈保存所有数据,一个栈保存最小数据集 """ class MyStack: def __init__(self): self.datastack = list() self.minstack = list() def push(self, value): length = len(self.minstack) if length == 0: ...
class Solution: def maxDepth(self, root: TreeNode) -> int: if (root is None): return 0 if (root.left is None and root.right is None): return 1 left = self.maxDepth(root.left) right = self.maxDepth(root.right) return max(left, right) + 1
red_flags = [] class RedFlagsModel(): def __init__(self): self.db = red_flags def save(self, data): id = len(red_flags) + 1 payload = { "id": id, "title": data['title'], "description": data['description'], "location": data['location'],...
cumprimentos = ["Olá", "oi", "i aê!", "bom dia"] respostas = [ "Estou às suas ordens","Pode falar,estou te ouvindo", "quais são suas ordens Mestre"] dispensas = [ 'desligar', 'sair', 'tchau kali', 'tchau cali', 'dispensada', 'encerrar']
#------------------------------------------------------------------------------# # Copyright 2018 Gabriele Valentini. All rights reserved. Use of this source # # code is governed by a MIT license that can be found in the LICENSE file. # #----------------------------------------------------------------------------...
""" Expressões Lambda - Conhecidas por expressões lambdas, são funções sem nome ou seja funções anônimas. # Função em python def soma(a,b): return a+b - Geralmente são usadas para ordenações e filtragem de dados. """ # Sintaxe expre = lambda x: (4 * x) + (5/x) print(expre(3)) # A função lambda só funciona qua...
r""" Git errors This module provides subclasses of ``RuntimeError`` to indicate error conditions when calling git. AUTHORS: - Julian Rueth: initial version """ #***************************************************************************** # Copyright (C) 2013 Julian Rueth <julian.rueth@fsfe.org> # # Distribu...
class Solution(object): memo = {0: [], 1: [TreeNode(0)]} def allPossibleFBT(self, N): if N not in Solution.memo: ans = [] for x in xrange(N): y = N - 1 - x for left in self.allPossibleFBT(x): for right in self.allPossibleFBT(y)...
__all__ = ['cohort', 'daterange', 'dimension', 'metric', 'order', 'pivot', 'report_request', 'segment']
""" elstruct.writer._qchem5 parameters """ OPTION_EVAL_DCT = { }
word = input("Give me a word: ") wrong = True while wrong: if word == "banana": wrong = False print("END GAME") else: print("WRONG") word = input("Give me a word: ")
while True: try: line = input().strip().split(' ') except EOFError: break winner = 3 for i in range(3): if line[i] == 'pedra' and line[(i +1) % 3] == 'tesoura' and line[(i +1) % 3] == line[(i + 2) % 3]: winner = i break elif line[i] == 'papel' an...
# Solution A: class Solution: def reverse(self, x): if -10 < x < 10: return x str_ = str(x) if str_[0] != '-': str_ = str_[::-1] res = int(str_) else: str_ = str_[:0:-1] res = int(str_) res = -res return ...
nodes = {} node_stats = {} buckets_summary = {} stats_summary = {} bucket_info = {} buckets = {} stats = { "minute" : { 'disk_write_queue' : {}, 'cmd_get' : {}, 'cmd_set' : {}, 'delete_hits' : {}, 'curr_items' : {}, 'vb_replica_curr_items' : {}, 'curr_connec...
n = int(input()) a = list(map(int,input().split())) i = 0 money=0 while i<n-1: while i<n-1 and a[i]>=a[i+1]: i+=1 if i==n-1: break buy_at=i i+=1 while i<n and a[i]>=a[i-1]: i+=1 sell_at=i-1 money+=a[sell_at]-a[buy_at] print(money)
# # PySNMP MIB module HUAWEI-NAP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-NAP-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:47:27 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
class Color(): def __init__(self, red=0, green=0, blue=0, type=False): self.red = red self.green = green self.blue = blue # False = 15bit, True = 24bit self.__type = type if self.__type: self.assert24Bit() else: self.assert15Bit() ...
""" Problem : Find out the missing number Author : Alok Tripathi """ def getMissingNo(arr): n = len(arr) # Sum of (N+1) * (N+2) natural number [n is length of arr] total = (n + 1) * (n + 2) / 2 sum_of_arr = sum(arr) return int(total - sum_of_arr) # sum of n... natural no. - sum of array if __...
a = int(input()) v = 0 for x in range(1,10+1): print(v+1,"x",a,"=",a*(v+1)) v = v+ 1
""" A OISC emulation using the Subleq operation. Tom Findlay (findlaytel@gmail.com) Feb. 2021 """ class whisk: def __init__(self, memory=30000): self.memory = [0]*memory def subleq(self,addr): if addr < 0: return None A = self.memory[addr] B = se...
# Implementation using list # Initializing queue using a list myQueue = [] # Adding elements to the queue myQueue.append(1) myQueue.append(2) myQueue.append(3) # Printing the queue print("Initial queue:", myQueue) # Size of the queue print("Size: ", len(myQueue)) # Check if queue is empty if not myQueue: print(...
#!/usr/bin/env python3 def merge(A,l,m,r): L,R = A[l:m+1],A[m+1:r+1] #copied L.append(float("inf")) R.append(float("inf")) i,j = 0,0 for k in range(l,r+1): A[k]= L[i] if L[i]<R[j] else R[j] i,j =(1+i,j) if L[i]<R[j] else (i,j+1) def merge_sort(A,l,r): if l<r: m = l+((...
# str(Color()) class Color: color = 'orange' def __str__(self): return Color.color print(str(Color()))
# 1. Define a function that accepts 2 values and returns # its sum, subtraction and multiplication. # SOLUTION: def result(a, b): sum = a+b sub = a-b mul = a*b print(f"Sum is {sum}, Sub is {sub}, & Multiply is {mul}") a = int(input("Enter value of a: ")) b = int(input("Enter value of b: ")) resul...
################################################################ ### User input parameters for C3S-LAA ################################################################ ### Required dependencies and input files # Path for the AMOS package that contains minimus assembler amos_path = "/usr/local/amos/bin/" ...
# general make_debug = False make_task = "" build_type = "Release" app_name = "MyApp"
sum = 0 for num in range(1,1000): if (num % 3 == 0 or num % 5 == 0): sum += num print(sum)
num1 = int(input("Insira o primeiro numero: ")) num2 = int(input("Insira o segundo numero: ")) if num1 > num2: print ("O maior número é:",num1) else: print ("O maior número é:",num2)
def split_lines(el): return el.split('\n') split_lines('10\n is\n the\n perfect\n number')
class Solution: # @param {integer[]} prices # @return {integer} def maxProfit(self, prices): if len(prices) < 2: return 0 minn = prices[:-1] maxn = prices[1:] mi = minn[0] for i in range(1, len(minn)): if minn[i] > mi: minn[i]...
class ManagedFile: """ Manager for open with context manager """ def __init__(self,name): self.name = name def __enter__(self): self.file = open(self.name, 'w') return self.file def __exit__(self, exc_type,exc_val, exc_tb): if self.file: self.file.clos...
__all__ = ['UndefinedType', 'undefined'] class _SingletonMeta(type): def __call__(self, *args, **kwargs): if not hasattr(self, '__instance__'): self.__instance__ = super().__call__(*args, **kwargs) return self.__instance__ class UndefinedType(metaclass=_SingletonMeta): ...
def bubbleSort(alist): for passnum in range(len(alist) - 1, 0, -1): for i in range(passnum): if alist[i] > alist[i + 1]: temp = alist[i] alist[i] = alist[i + 1] alist[i + 1] = temp alist = [54, 26, 93, 17, 77, 31, 44, 55, 20] bubbleSort(alist) pr...
def format_search_terms(search_terms): s='' q=[] if search_terms != None: for term in search_terms: q.append(term) q.append('%20') s= ''.join(q) return s def format_from_user(from_user): s='' q=[] if from_user != None: q.append('from%3A') ...
class EventBrokerError(Exception): pass class EventBrokerAuthError(EventBrokerError): pass
# We'll use a greedy algorithm to check to see if we have a # new max sum as we iterate along the along. If at any time # our sum becomes negative, we reset the sum. def largestContiguousSum(arr): maxSum = 0 currentSum = 0 for i, _ in enumerate(arr): currentSum += arr[i] max...
#Exercício Python 11: Faça um programa que leia a largura e a altura de uma parede em metros, calcule a sua área e a quantidade de tinta necessária para pintá-la, sabendo que cada litro de tinta pinta uma área de 2 metros quadrados. largura = float(input("Largura da parede: ")) altura = float(input("Altura da parede: ...
def diagonalDifference(arr): diagonal1 = 0 diagonal2 = 0 for pos, line in enumerate(arr): diagonal1 += line[pos] diagonal2 += line[len(arr)-1 - pos] return abs(diagonal1 - diagonal2)
class MaterialSubsurfaceScattering: back = None color = None color_factor = None error_threshold = None front = None ior = None radius = None scale = None texture_factor = None use = None
shiboken_library_soversion = str(6.1) version = "6.1.1" version_info = (6, 1, 1, "", "") __build_date__ = '2021-06-03T07:46:50+00:00' __setup_py_package_version__ = '6.1.1'
# S1 input_list = [] for i in range(int(6)): input_list.append(input()) win_counter = 0 loss_counter = 0 for i in input_list: if i == "W": win_counter += 1 else: loss_counter += 1 if win_counter == 1 or win_counter == 2: print("3") elif win_counter == 3 or win_counter == 4: print("2"...
""" Given a list of possibly overlapping intervals, return a new list of intervals where all overlapping intervals have been merged. The input list is not necessarily ordered in any way. For example, given [(1, 3), (5, 8), (4, 10), (20, 25)], you should return [(1, 3), (4, 10), (20, 25)]. Source: Daily Coding Prob...
class Evaluator: @staticmethod def zip_evaluate(coefs, words): if (len(coefs) != len(words)): return -1 return sum([coeff * len(word) for (coeff, word) in zip(coefs, words)]) @staticmethod def enumerate_evaluate(coefs, words): if (len(coefs) != le...
# You are given an array of desired filenames in the order of their creation. # Since two files cannot have equal names, the one which comes later will have # an addition to its name in a form of (k), where k is the smallest positive # integer such that the obtained name is not used yet. # # Return an array of names th...
load("@dwtj_rules_markdown//markdown:defs.bzl", "markdown_library") def index_md(name = "index_md"): markdown_library( name = name, srcs = ["INDEX.md"], )
length_check_fields=['reset_pc', 'physical_addr_size'] bsc_cmd = '''bsc -u -verilog -elab -vdir {0} -bdir {1} -info-dir {1} \ +RTS -K40000M -RTS -check-assert -keep-fires \ -opt-undetermined-vals -remove-false-rules -remove-empty-rules \ -remove-starved-rules -remove-dollar -unspecified-to X -show-schedule \ -show-m...
BOT_NAME = 'naver_movie' SPIDER_MODULES = ['naver_movie.spiders'] NEWSPIDER_MODULE = 'naver_movie.spiders' ROBOTSTXT_OBEY = False DOWNLOAD_DELAY = 2 COOKIES_ENABLED = True DEFAULT_REQUEST_HEADERS = { "Referer": "https://movie.naver.com/" } DOWNLOADER_MIDDLEWARES = { 'scrapy.downloadermiddlewares.useragent.U...
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def isPalindrome(self, head: ListNode) -> bool: if not head or not head.next: return True # print(head) slow, fast = head, head ...
# # @lc app=leetcode id=557 lang=python # # [557] Reverse Words in a String III # # https://leetcode.com/problems/reverse-words-in-a-string-iii/description/ # # algorithms # Easy (63.15%) # Likes: 624 # Dislikes: 67 # Total Accepted: 127.4K # Total Submissions: 198.3K # Testcase Example: `"Let's take LeetCode co...