content
stringlengths
7
1.05M
""" Good morning! Here's your coding interview problem for today. This question was asked by Zillow. You are given a 2-d matrix where each cell represents number of coins in that cell. Assuming we start at matrix[0][0], and can only move right or down, find the maximum number of coins you can collect by the bottom ri...
Basic_HEADER = {'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS', 'Access-Control-Allow-Headers': 'access_token, accessToken,origin,' ' x-csrftoken, content-type, accept', 'Access-Control-Max-...
# HEAD # Membership Operators # DESCRIPTION # Describe the usage of membership operators # RESOURCES # # 'in' operator checks if an item is a part of # a sequence or iterator # 'not in' operator checks if an item is not # a part of a sequence or iterator lists = [1, 2, 3, 4, 5] dictions = {"key": "valu...
class Character: def __init__(self): self._firstName = '' self._lastName = '' self._pic = '' self._position = '' self._bio = '' @property def firstName(self): return self._firstName @property def lastName(self): return self._lastN...
''' Criar uma class Carro com dois atributos compostos por duas outras classes: 1. Motor 2. Direção A classe Motor deve controlar a velocidade, ele oferece os seguintes atributos: 1. Atributo de dado velocidade 2. Método acelerar, que deverá incrementar print(o valor) de uma unidade 3. Método desacelerar, que deverá ...
def test_signal_wikidata_url(ranker): rank = lambda url: ranker.client.get_signal_value_from_url("wikidata_url", url) assert rank("http://www.douglasadams.com") > 0.5 assert rank("http://www.douglasadams.com/?a=b") > 0.5 assert rank("http://www.douglasadams.com/page2") == 0. # TODO, check domain? ...
course = " Python Programming" print(course.upper()) print(course.lower()) print(course.title()) # tira o espaço print(course.strip()) print(course.find("Pro")) print(course.replace("P", "-")) # ve se tem a palavra nessa sting print("Programming" not in course)
#!/usr/bin/env python3 fileNum = input('File Number: ') file = bytearray(open(fileNum + '.txt', 'rb').read()) seed = input('Seed (format is XXX, XXX, XXX): ') init = int(seed[0:3]) mult = int(seed[5:8]) inc = int(seed[10:13]) key = "" current = init for i in range(120): key += chr(current) current *= mult ...
num=int(input()) r=[] for i in range(num): array=input().split(' ') array=[int(m) for m in array if m !=''] array.remove(array[0]) js=[] os=[] for k in range(len(array)): if array[k]%2==0: os.append(array[k]) else: js.append(array[k]) js=sorted(js) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 27 19:56:21 2020 @author: darrenhsu """ def word_reduce(s, vowel=0, repeat=0, listAll=False): vowel_set = {'a','e','i','o','u','A','E','I','O','U'} # Assertions if type(s) == list: pass elif listAll == False: new_s =...
class Solution: def isValid(self, s: str) -> bool: stack = [] for st in s: if st in ('(', '{', '['): stack.append(st) else: if len(stack) < 1: return False tmp = stack.pop() if st == ')' and t...
class Camera(): def __init__(self, camera_matrix, projection_matrix, parameters={}): self.camera_matrix = camera_matrix self.projection_matrix = projection_matrix self.parameters = parameters class Material(): def __init__(self, shader, parameters={}): self.shader = shader ...
""" * Assignment: Decorator Function Memoization * Complexity: easy * Lines of code: 3 lines * Time: 8 min English: 1. Create decorator `@cache` 2. Decorator must check before running function, if for given argument the computation was already done: a. if yes, return from `_cache` b. if ...
def factorial(n): result = 1 for i in range(n): result *= i + 1 return result
#!/bin/python3 def swap_case(s): tmp = [] for c in s: if c.islower(): tmp.append(c.upper()) else: tmp.append(c.lower()) return ''.join(tmp) def main(): s = input() result = swap_case(s) print(result) if __name__ == '__main__': main()
__author__ = 'roeiherz' """ You have an integer matrix representation a plot of land, where the value at that location represents the height above see level. A value of zero indicates water. A pond is a region of water connected vertically, horizontally, or diagonally. The size of the pond is the total number of conn...
# Date: 2020/11/05 # Author: Luis Marquez # Description: # This is a demostration of brute-force Search algorithm, in this program we'll calculate # an exact square root of a number 'n' -> Objective #run def run(): answer = 0 objective = int(input(f"Type an integer: ")) while a...
''' Leia 2 valores inteiros (A e B). Após, o programa deve mostrar uma mensagem "Sao Multiplos" ou "Nao sao Multiplos", indicando se os valores lidos são múltiplos entre si. | Input Sample | Output Samples | | ------------ | ------------------ | | 6 24 | Sao Multiplos | | ------------ | --------------...
def foo() -> int: return 1 foo()
#import Adafruit_DHT # GPIO Channel for RGB LED Strip r_channel = 25 g_channel = 27 b_channel = 22 # GPIO Channel for white LED Strip w_channel = 18 # Location Latitude and Longitude (Auckland, New Zealand) latitude = "-36.84" longitude = "174.74" # RGBW Value to use during Day day_colour = [75, 255, 0, 100] # RG...
def game_of_life(alive = []): return list(set(newborns(alive) + staying_alive(alive))) def newborns(alive): return next_living_from( cells = neighbors_of_all_alive(alive), alive = alive, valid_neighbor_counts = [3] ) def staying_alive(alive): return next_living_from( ce...
""" emailAge exception handling module. """ class EmailAgeServiceException(Exception): """ Exception: Serves as the exception handler for emailAge requests. """ def __init__(self, error_code, value): self.error_code = error_code self.value = value def __unicode__(self): r...
var = { #Infection Rate #Source: https://returntolearn.ucsd.edu/dashboard/index.html "infection_rate" : 0.0075, #Viral Load in the Sputum #Source: https://doi.org/10.1186/s13054-020-02893-8 "cv": 1e9, #Quanta per RNA copy (Conversion Factor) #Source: https://onlinelibrary.wiley.com/doi/full/10.1111/j.1539-6924.2010.0...
"""child_b docstr""" class B: """This class is defined in .child_b.""" def b(self): return 1
num1 = 1 num2 = 2 num3 = 45 num4 = 23
# -*- coding: utf-8 -*- ''' Let's teach the Robots to distinguish words and numbers. You are given a string with words and numbers separated by whitespaces (one space). The words contains only letters. You should check if the string contains three words in succession. For example, the string "start 5 one two three 7...
class Solution: # @return a string def convert(self, s, n): if n <= 0: return '' if n == 1 or n >= len(s): return s step = n * 2 - 2 a = step b = step res = '' for i in range(n): res += s[i] j = i ...
DB1 = 'default' DB2 = 'streamdata' DB3 = 'streamtimeseries' # List of apps that should use Redshift # Currently, we don't seem to be able to add another table # so until we figure out, we can only keep one REDSHIFT_APPs = ['streamdata', ] STREAM_TIME_SERIES_APPs = ['streamtimeseries', ]
class Solution: """ @param: A: An integer matrix @return: The index of the peak """ def findPeakII(self, A): m, n = len(A), len(A[0]) for i in range(1, m - 1): left, right = 0, n - 1 while left + 1 < right: mid = (left + right) // 2 ...
def color_to_rgb(rgb_or_name): color_name_to_rgb = {"black": [0, 0, 0], "red": [1, 0, 0], "green": [0, 1, 0], "blue": [0, 0, 1], "yellow": [1, 1, 0], "orange": [1, 0.5, 0], "white":[1,1,1]} if isinstance(rgb_or_name, str): ...
def parse_dset_config(path): """Parses the dset configuration file""" options = dict() with open(path, 'r') as fp: lines = fp.readlines() for line in lines: line = line.strip() if line == '' or line.startswith('#'): continue key, value = line.split('=') ...
""" File: largest_digit.py Name: Gibbs ---------------------------------- This file recursively prints the biggest digit in 5 different integers, 12345, 281, 6, -111, -9453 If your implementation is correct, you should see 5, 8, 6, 1, 9 on Console. """ def main(): """ This function recursively finds the biggest dig...
""" You are given an array of integers. You should find the sum of the integers with even indexes (0th, 2nd, 4th...). Then multiply this summed number and the final element of the array together. Don't forget that the first element has an index of 0. For an empty array, the result will always be 0 (zero). Input: A li...
# Single-quoted string is preceded and succeeded by newlines. # Translators: This is a helpful comment. _( '3' )
""" Znajdz brakujacy element w liscie. Ciag arytmetyczny. """ # Wersja 1 def znajdz_brakujacy_element(lista): suma_przedzialu = (len(lista) + 1) * (min(lista) + max(lista)) // 2 return suma_przedzialu - sum(lista) # Testy poprawnosci lista = [6, 8, 4, 10, 14, 2] wynik = 12 assert znajdz_brakujacy_element(li...
class Process: def __init__ (self, dados): """ Description Método construtor da classe Process :type self: Process (class) :type dados: dict :param dados: Estrutura contendo todas as informações coletadas na main.py do arquivo. """ self.__id = dados['id'] self.__tamanho = dados[...
S = input() level = len(S) x = 0 y = 0 for i in range(level): if S[i] == '1' or S[i] == '3': x += 2**(level - i - 1) if S[i] == '2' or S[i] == '3': y += 2**(level - i - 1) print(level, x, y)
#! /usr/bin/env python3 class Pattern: def __init__ (self, order): #rev = {} #I = range (0, len (order)) #for i, v in zip (I, order): # if v in rev: temp = rev[v] # else: temp = [] # rev[v] = tuple (temp + [i]) self.order = order #self.rev = rev def __repr__ (self): return "Pattern [order=...
questions = { 'What year was the MicroBit educational foundation created?': [ '2016', '2014', '2017', 0 ], 'What year was the first computer invented?': [ '1954', '1943', '1961', 1 ], ...
# Name: Reetesh Zope # Student ID: 801138214 # Email ID: rzope1@uncc.edu """ edge.py _________ A class used to represent the link between two routers in the network. ---------- Attributes ---------- source : str A string which contains source router name of the link destination : list ...
""" 9.2 – Três restaurantes: Comece com a classe do Exercício 9.1. Crie três instâncias diferentes da classe e chame describe_restaurant() para cada instância. """ class Restaurant: def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisin...
# -*- coding: utf-8 -*- """ Created on Mon Jul 30 21:17:33 2018 @author: gaoxi """ def printdata(data): print(data)
''' Created on 22.11.2016 @author: rustr ''' MSG_IDENTIFIER = 1 MSG_COMMAND = 2 # [command_id, counter, position, orientation, optional values] MSG_COMMAND_RECEIVED = 3 MSG_COMMAND_EXECUTED = 4 MSG_CURRENT_POSE_CARTESIAN = 5 # [position, orientation] MSG_CURRENT_POSE_JOINT = 6 # [j1j2j3j4j5j6] MSG_CURRENT_DIGITAL_IN ...
#Jacob Hardman #CS301 Algorithms and Data Structures #Dr. Nathaniel Miller #Stack class Stack: def __init__(self): self.items = [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[len(self.items)-1]...
def brute(n): cnt = 0 for a in range(1, n + 1): for b in range(a + 1, n + 1): for c in range(b + 1, n + 1): for d in range(c + 1, n + 1): if a * d == b * c: print('%s * %s = %s * %s = %s' % (a, d, b, c, a * d)) ...
#Prints all the numbers from 1 - 1000 count = 0 while count <= 1000: print(count) count += 1
# Given two arrays, a and b, calculate how many times the following is true: # i <= j # a[i] - b[j] = a[j] - b[i] # This works on O(n^2) time def checkArraysSlow(a, b): counter = 0 for i in range(len(a)): for j in range(i, len(a)): if a[i] - b[j] == a[j] - b[i]: counter += 1 re...
class Solution: # data structure type: stack def decodeString(self, s: str): #Traverse the string stack, currCount, currString = [], 0, "" for c in s: if c == '[': stack.append(currString) stack.append(currCount) currString = ""...
"""1.9 String Rotation: Assume you have a method isSubst ring which checks if one word is a substring of another. Given two strings, 51 and 52, write code to check if 52 is a rotation of 51 using only one call to isSubstring (e.g., "waterbottle" is a rotation of "erbottlewat"). """ def string_rotation(string_1: str, st...
print("Moi je m\'appelle \'Lolita\' ") print("Lo ou bien Lola du pareil au même") print("Moi je m\'appelle \'Lolita\' ") print("Qand je rêve aux loups, c\'est printlola qui saigne") print("[...]") print("C\'est pas ma faute") print("Et quand je donne ma langue aux chats je vois les autres") print("Tout prêts à se jete...
# -*- coding: utf-8 -*- # Copyright 2021 ICONation # # 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 agre...
# -*- coding: utf-8 -*- """ Created on Wed May 18 08:16:50 2016 @author: ericgrimson """ class Student(MITPerson): pass class UG(Student): def __init__(self, name, classYear): MITPerson.__init__(self, name) self.year = classYear def getClass(self): return self.year class Grad(St...
__author__ = 'postrowski' # -*-coding: utf-8-*- class MakeDict(object): @staticmethod def make_dict(list1, list2, list3): """ Function makes a dictionary. :param list1: input list (keys()) :param list2: input list (nested keys()) :param list3: input list (nested v...
f = open("log/hbase_total.log") lines = f.readlines() indices = [index for index, l in enumerate(lines) if '======== tag_old: ' in l] i = indices[0] optional_required = [] rest = [] add_req = [] for j in indices[1:]: cs = lines[i+1:j] for c in cs: t = lines[i] t = t[:t.index('#change')] tags = t.replac...
""" * Assignment: FuncProg Callable Define * Complexity: easy * Lines of code: 4 lines * Time: 5 min English: 1. Define function `wrapper` 2. Function `wrapper` takes arbitrary number of positional and keyword arguments 3. Function `wrapper` prints `hello from wrapper` 4. Define function `check`...
def option_price_call_american_binomial(S, K, r, sigma, t, steps): """American Option (Call) using binomial approximations Converted to Python from "Financial Numerical Recipes in C" by: Bernt Arne Odegaard http://finance.bi.no/~bernt/gcc_prog/index.html @param S: spot (underlying) price @param...
num_stages = 6 num_proposals = 100 model = dict( type='SparseRCNN', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', ...
# Exercício Python 01: 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. l = float(input('Qual a largura da parede: ')) a = float(input('Qual a altura da pare...
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution(object): def sortList(self, head): """ :type head: ListNode :rtype: ListNode """ value_array = [] ...
{ "comment": "Create a twitter app here https://apps.twitter.com/ then and copy the key info below", "consumer_key": "(your key goes here)", "consumer_secret": "(your secret key goes here)", "access_token": "(your key goes here)", "access_token_secret": "(your secret key goes here)" }
while True: n = int(input('\033[1;97mQuer ver a tabuada de qual valor? ')) if n < 0: break print('=' * 19) for c in range(1, 11): if c == 10: print('|\033[91m{:>4} \033[97mx \033[91m{} \033[97m= \033[91m{:<5}\033[97m|'.format(n, c, n * c)) break print('|\0...
# The mapping here uses hhblits convention, so that B is mapped to D, J and O # are mapped to X, U is mapped to C, and Z is mapped to E. Other than that the # remaining 20 amino acids are kept in alphabetical order. # There are 2 non-amino acid codes, X (representing any amino acid) and # "-" representing a missing ami...
""" Classes that represents a manifold. An object that contains information about a collision between two objects. """ class Manifold: """ A manifold representation that gives information about collision of two objects. """ def __init__(self, obj_a, obj_b, penetration, normal): self.obj_a ...
class Queen: def __init__(self, row, column): if row < 0: raise ValueError("row not positive") if not 0 <= row <= 7: raise ValueError("row not on board") if column < 0: raise ValueError("column not positive") if not 0 <= column <= 7: rai...
class BaseClassAnnotated: def __init__(self, name: str): self.name = name class DerivedClass(BaseClassAnnotated): def __init__(self, name: str): super().__init__(name) self.param = None def get_param(self): return self.param
name = "Baidu" url = "http://m.baidu.com/" clip = "baidu" ua = None if not self.isCheckable(): self.setCheckable(True) self.setChecked(True) if not self.parentWindow().hasSideBar(name): self.parentWindow().addSideBar(name, url, clip, ua) else: self.parentWindow().toggleSideBar(name)
""" Profile ../profile-datasets-py/div83/065.py file automaticaly created by prof_gen.py script """ self["ID"] = "../profile-datasets-py/div83/065.py" self["Q"] = numpy.array([ 2.70142300e+00, 3.40702800e+00, 4.79249700e+00, 6.17865200e+00, 6.52696700e+00, 6.52924700e+00, 6.5193...
class Solution: def findShortestWay(self, maze, ball, hole): m, n, q, stopped = len(maze), len(maze[0]), [(0, "", ball[0], ball[1])], {(ball[0], ball[1]): [0, ""]} while q: dist, pattern, x, y = heapq.heappop(q) if [x, y] == hole: return pattern fo...
#!/usr/bin/env python # -*- coding: utf8 -*- # # __init__.py # José Devezas (joseluisdevezas@gmail.com) # 2017-03-09 class ArmyAntException(Exception): pass
#!/usr/bin/env python # Copyright 2017 The Forseti Security Authors. All rights reserved. # # 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 # #...
class HashTable: def __init__(self, len = 4): self._array = [] for i in range(len): self._array.append([]) def hash(self, key): ''' Use python hash function and len to get the index :param key: object :return: number ''' ln = len(sel...
#function for getting the mutational positions and relevant information from VCF file #-------------------------------------------------------------------------------------------------------------------------- def Get_Variant_PositionsMutationScores(VCFpath): """ VCFpath is the variant.vcf file path returns a li...
#3 tipos de inicialização de tuplas: (tupla) ou [lista] ou {dicionário} """lancheSimples = 'Hamburguér' lancheSimples= 'Sucão' lanche = ('Hamburguer', 'Suco', 'Pizza', 'Pudim', 'Batata Frita') print(f'O tamanho da tupla de lanche: {len(lanche)}\n') for comida in range(0, len(lanche)): print(f'Hoje eu comi {lanch...
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def okapi_deps(): maybe( http_archive, "bazel_skylib", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1....
def main(): data = ("Robin", 10, "chocolates") format_string = "Hello %s. You are currently left with %d %s." print(format_string %data) return 0 if __name__ == '__main__': main()
x = int(input()) y = int(input()) if x > y: a = y b = x if x <= y: a = x b = y a=a+1 while a < b: if a % 5 == 2 or a % 5 == 3: print(a) a = a + 1
# flake8: noqa led_grey = b'iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QkZDh80173PwgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAgAElEQVR42u2d228bR57vv30nRYqUZMlWHMcXObJkOx6fjAfwmcBYIEAOdt/maR4GmOf8Ud7dt3mbp32fOVnM4uzsOQNvMAh2Z5ONZwNbtuT4xJYo...
# signature types SIGHASH_ALL = 1 SIGHASH_NONE = 2 SIGHASH_SINGLE = 3 SIGHASH_FORKID = 0x40 SIGHASH_ANYONECANPAY = 0x80
class Solution(object): def romanToInt(self, s): """ :type s: str :rtype: int """ roman = { 'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000 } last = 0 ...
#! /usr/bin/env python3 n, m = map(int, input().split()) if n == 3: print(3, 0) print(3, 1, 2) else: print(0, 2) print(1, 2) print(3, 4)
class Solution(object): def isPerfectSquare(self, num): """ :type num: int :rtype: bool """ start = 1 while num > 0: num -= start start += 2 return num == 0
# # PySNMP MIB module LIGO-802DOT11-EXT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/LIGO-802DOT11-EXT-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:07:06 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (def...
# # PySNMP MIB module HH3C-SNMP-EXT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-SNMP-EXT-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:29:41 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
def getGuessedWord(secretWord, lettersGuessed): ''' secretWord: string, the word the user is guessing lettersGuessed: list, what letters have been guessed so far returns: string, comprised of letters and underscores that represents what letters in secretWord have been guessed so far. ''' # F...
def main(): try: configuration = open('config.txt') except Exception: print("Couldn't find the config.txt file!") if __name__ == '__main__': main()
#from sys import stdin #file = stdin file = open(r'.\data\maplambda.txt', 'rt' ) data = int(file.read().strip()) def fib(n): result = [] a, b = 0, 1 while n > 0: result.append(a) a, b = b, a+b n -= 1 return result print(list(map(lambda x: x**3, fib(data)))) #print(*map(lambda x: x**3, fib(data)), sep="\n")
# Write code to remove duplicattes from an unsorted linked list # Follow up: # How would you solve this problem if a temporary # buffer is not allowed? class Node: def __init__(self, data=None, next=None): self.data = data self.next = next def __repr__(self): return self.data de...
#!/usr/bin/env python3 # Some columns are longer than others table1 = [['apples', 'oranges', 'cherries', 'banana'], ['Alice', 'Bob', 'Carol', 'David'], ['dogs', 'cats', 'moose', 'goose', 'duck']] table2 = [] def print_table(table): # Find out the number of rows of the longest columns # and the...
#my solution print("Welcome to the tip calculator.") total_bill = float(input("What was the total bill? ")) amount_of_people = int(input("How many people to split the bill? ")) tip = int(input("What percentage tip would you like to give? 10, 12, or 15? ")) payment = float((tip * total_bill/100 + total_bill)/amount_of_...
""" This file is part of Ludolph: Ansible plugin Copyright (C) 2015 Erigones, s. r. o. See the LICENSE file for copying permission. """ __version__ = '0.4'
#!/usr/bin/python3 # 3-common_elements.py def common_elements(set_1, set_2): """Return a set of common elements in two sets.""" return (set_1 & set_2)
def say_hello(name=None): if name is None: return "Hello, world!" else: return f"Hello, {name}!"
# coding: utf-8 ############################################################################## # Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries. # # Subject to your compliance with these terms, you may use Microchip software # and any derivatives exclusively with Microchip products. It is your # resp...
# 変数nameに文字列「にんじゃわんこ」を代入してください name = 'にんじゃわんこ' # 変数nameの値を出力してください print(name) # 変数numberに数値の7を代入してください number = 7 # 変数numberの値を出力してください print(number)
n = int(input()) name = [] for _ in range(n): name.append(input()) if name == sorted(name): print("INCREASING") elif name == sorted(name)[::-1]: print("DECREASING") else: print("NEITHER")
BLACK = (0,0,0) WHITE = (255,255,255) GREEN = (0,255,0) RED = (255,0,0) BLUE = (0,0,255) colors = {'Black': BLACK, 'White': WHITE, 'Green': GREEN, 'Red': RED, 'Blue': BLUE}
# pinspect_support_module_4.py # Copyright (c) 2013-2019 Pablo Acosta-Serafini # See LICENSE for details # pylint: disable=C0111,W0212 USAGE1 = """\ This is a test\ of a multi-line string """ USAGE2 = r""" This is a test of a raw multi-line string """ USAGE3 = r"""This is a test of a single-line stri...
def func(): """ A multi-line docstring """ def inner_func(): """ A multi-line docstring"""
# Copyright 2017, bwsoft management # # 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 wr...
''' The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it returns 3 if there is only 3 characters left in the file. By using the read4 API, implement the function int read(char *buf, int n) that reads n characters from the fil...