content stringlengths 7 1.05M |
|---|
data = (
'Fu ', # 0x00
'Zhuo ', # 0x01
'Mao ', # 0x02
'Fan ', # 0x03
'Qie ', # 0x04
'Mao ', # 0x05
'Mao ', # 0x06
'Ba ', # 0x07
'Zi ', # 0x08
'Mo ', # 0x09
'Zi ', # 0x0a
'Di ', # 0x0b
'Chi ', # 0x0c
'Ji ', # 0x0d
'Jing ', # 0x0e
'Long ', # 0x0f
'[?] ', # 0x10
'Niao ', ... |
def aumentar(value, percent):
'''
--> Função que exibe um valor com um aumento percentual.
--> Parâmetros:
* value --> Preço, salário ou um valor qualquer;
* percent --> Percentual que deseja aumentar.
--> Retorno:
* Retorna o valor calculado com o aumento.
'''
... |
# Copyright 2017 Internap.
#
# 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, so... |
# -*- coding:utf-8 -*-
class Solution:
def FindNumbersWithSum(self, array, tsum):
# write code here
l, r = 0, len(array) - 1
while l < r:
if array[l] + array[r] < tsum: l += 1
elif array[l] + array[r] > tsum: r -= 1
else: return [array[l], array[r]]
... |
filename_domain = 'ig_domain.iga'
regions = {
'Omega' : 'all',
'Omega_0' : 'vertices in (x > 1.5) & (y < 1.5)',
'Gamma1' : ('vertices of set xi10', 'facet'),
'Gamma2' : ('vertices of set xi11', 'facet'),
}
fields = {
'temperature' : ('real', 1, 'Omega', None, 'H1', 'iga'),
}
variables = {
'T'... |
def test_index_route(test_client):
response = test_client.get('/')
assert response.status_code == 200
assert '<title>Home | Flask-Startup</title>' in response
|
"""Module contains helper methods used by other modules in the package."""
def env_exists(env_variable: str) -> bool:
"""Validates if env variable was provided and is not an empty string.
Args:
env_variable: str, name of the env variable
Returns:
True: if env provide and not an empty str... |
"""
Warnings used throughout the module. Exported and inhereited from a commmon
warning class so as to facilitate the filtering of warnings
"""
# pylint: disable=too-few-public-methods, missing-docstring
class SparseSCWarning(RuntimeWarning):pass
class UnpenalizedRecords(SparseSCWarning):pass
|
class Motor:
def __init__(self):
self.velocidade = 0
def acelerar(self):
self.velocidade += 1
def frear(self):
self.velocidade -= 2
self.velocidade = max(0, self.velocidade)
motor = Motor()
velocidade = motor.velocidade
print(motor.velocidade)
motor.acelerar()
print(motor... |
class MirrorModifier:
merge_threshold = None
mirror_object = None
mirror_offset_u = None
mirror_offset_v = None
use_clip = None
use_mirror_merge = None
use_mirror_u = None
use_mirror_v = None
use_mirror_vertex_groups = None
use_x = None
use_y = None
use_z = None
|
# -*- coding: utf-8 -*-
# 店铺服务
class ShopService:
__client = None
def __init__(self, client):
self.__client = client
def get_shop(self, shop_id):
"""
查询店铺信息
:param shopId:店铺Id
"""
return self.__client.call("eleme.shop.getShop", {"shopId": shop_id})
d... |
# create a game the guesses users secret number using bisection search
input("Please think of a number between 0 and 100!")
low = 0
high = 100
solved = False
while not solved:
guess = (high+low)//2
print('Is your secret number ' + str(guess) + '?')
response = input("Enter 'h' to indicate the guess is too high. E... |
"""c protobuf and grpc rules."""
load(":c_proto_compile.bzl", _c_proto_compile = "c_proto_compile")
load(":c_proto_library.bzl", _c_proto_library = "c_proto_library")
# Export c rules
c_proto_compile = _c_proto_compile
c_proto_library = _c_proto_library
|
class persona:
def __init__(self,a,b):
self.a=a
self.b=b
def saluda(self,c):
return f"hola {c.a},me llamo {self.a}"
david=persona("David",35)
erika=persona("Erika",32)
print(david.saluda(erika))
|
schema = """
CREATE TABLE owners (
name TEXT PRIMARY KEY,
key TEXT
);
CREATE TABLE zones (
id TEXT PRIMARY KEY,
owner TEXT,
aws_access_key TEXT,
aws_secret_key TEXT,
name TEXT
);
CREATE TABLE domains (
zone_id TEXT,
name TEXT,
type TEXT,
value TEXT,
PRIMARY KEY (zone_id... |
"""Python module to know if a number is prime"""
def is_prime(number: int) -> bool:
"""Returns True if number is prime or False if the number is not prime"""
results_list = [x for x in range(2, number) if number % x == 0]
return len(results_list) == 0
def run():
number: int = 'hola'
number_is_pr... |
test = {
'name': 'Question 1',
'points': 2,
'suites': [
{
'cases': [
{
'answer': 'Domain is numbers. Range is numbers',
'choices': [
'Domain is numbers. Range is numbers',
'Domain is numbers. Range is strings',
'Domain is strings. Range is ... |
class ApplicationError(Exception):
pass
class FileNotFound(ApplicationError):
pass
|
input_ = '6,19,0,5,7,13,1'
num_iterations = 30000000
starting_nums = list(map(int, input_.split(',')))
last_times_spoken_dict = dict(zip(starting_nums, range(1, len(starting_nums) + 1)))
last_time_spoken = None # assume that starting nums contain no duplicates
for turn in range(len(starting_nums) + 1, num_iterations +... |
inputString = input("\nEnter the string : \n")
position = int(input("\nEnter the position : \n"))
subString = input("\nEnter the Substring\n")
inputString = inputString[:position-1] + subString + inputString[position-1:]
print("\nThe new string becomes : \n")
print(inputString) |
# global settings module for fortiwlc_exporter
DEBUG = False
ONE_OFF = []
NO_DEFAULT_COLLECTORS = True
TIMEOUT = 60
EXPORTER_PORT = 9118
WLC_USERNAME = None
WLC_PASSWORD = None
WLC_API_KEY = None
|
class InvalidOpenRocketSimulationFileException(Exception):
"""Raised when the format of the selected CSV file doesn't match the expected OpenRocket simulation file format"""
class OpenRocketSimulation:
def __init__(self, filename):
self.time = []
self.altitude = []
try:
wi... |
# Implement the function count_dict_difference below.
# You can define other functions if it helps you decompose and solve
# the problem.
# Do not import any module that you do not use!
# Remember that if this were an exam problem, in order to be marked
# this file must meet certain requirements:
# - it must contain ... |
# This file is a part of Arjuna
# Copyright 2015-2021 Rahul Verma
# Website: www.RahulVerma.net
# 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... |
def signum(a, b):
"""
Returns 1 if value of object a is greater than that of object b.
Returns 0 if objects are equivalent in value.
Returns -1 if value of object a is lesser than that of object b.
"""
return int(a > b) - int(a < b)
class Comparable:
"""
An abstract class that can be i... |
#!/usr/bin/python3
__author__ = "Mark H. Meng"
__copyright__ = "Copyright 2021, National University of S'pore and A*STAR"
__credits__ = ["G. Bai", "H. Guo", "S. G. Teo", "J. S. Dong"]
__license__ = "MIT"
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033... |
# Complete the function below.
def arbitrage(quotes):
results = []
for quote in quotes:
# initial 100,000 dollars
initial = 100000
attrs = quote.split(' ')
attrs = list(map(float,attrs))
result = initial/attrs[0]/attrs[1]/attrs[2]
profit = int(result-initial)
... |
class number:
def __init__(self):
self.a=10
self.b=20
class addition(number):
def add(self):
self.c=self.a+self.b
print('addition :',self.c)
class substraction(number):
def sub(self):
self.c=self.a-self.b
print('substraction :',self.c)
class multiplicat... |
class LogAndRaise:
def __init__(self, logger):
self.logger = logger
def logAndRaise(self, error, message, logMessage=None):
self.logger.error(message if not logMessage else logMessage)
raise error(message)
|
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/definition.set.ipynb (unless otherwise specified).
__all__ = []
# Cell
if __name__ == '__main__':
embed_markdown_file('definition.set.md',
origin=ORIGIN, destination=DESTINATION) |
{
'name': 'Website Form',
'category': 'Website/Website',
'summary': 'Build custom web forms',
'description': """
Customize and create your own web forms.
This module adds a new building block in the website builder in order to build new forms from scratch in any website page.
""",
... |
class HashMap1(object):
def __init__(self, hashMap={}):
self.hashMap = hashMap
def add(self, key, value):
if (key not in self.hashMap):
self.hashMap[key] = value
return
raise Exception("Key is already within our data structure")
def update(se... |
# Copyright 2020 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, ... |
'''
This mission is the first one of the series. Here you should find the length of the longest substring that consists of the same letter. For example, line "aaabbcaaaa" contains four substrings with the same letters "aaa", "bb","c" and "aaaa". The last substring is the longest one, which makes it the answer.
Input: ... |
class Solution:
def numRescueBoats(self, people: List[int], limit: int) -> int:
people.sort()
low = total = 0
high = len(people) - 1
while low <= high:
total += 1
if people[low] + people[high] <= limit:
low += 1
high -= 1
re... |
# -*- coding: utf-8 -*-
"""
This file is covered by the LICENSING file in the root of this project.
"""
__author__ = "rapidhere"
__all__ = ["ASYNC_OP_RESULT", "ASYNC_OP_QUERY_INTERVAL", "ASYNC_OP_QUERY_INTERVAL_LONG", "REMOTE_CREATED_RECORD"]
class ASYNC_OP_RESULT:
SUCCEEDED = "Succeeded"
IN_PROGRESS = "InPr... |
# Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def reverseBetween(self, head: ListNode, left: int, right: int) -> ListNode:
curr_node = head
count = 1
prev = None
while... |
class RecordScore():
"""Class to track a game's maximum score"""
def __init__(self):
self.cache = []
def __call__(self, n):
if n not in self.cache:
self.cache.append(n)
return max(self.cache)
|
class Solution:
def minFlips(self, s: str) -> int:
n = len(s)
# count[0][0] := # of '0' in even indices
# count[0][1] := # of '0' in odd indices
# count[1][0] := # of '1' in even indices
# count[1][1] := # of '1' in odd indices
count = [[0] * 2 for _ in range(2)]
for i, c in enumera... |
#
# @lc app=leetcode id=1971 lang=python3
#
# [1971] Find if Path Exists in Graph
#
# https://leetcode.com/problems/find-if-path-exists-in-graph/description/
#
# algorithms
# Easy (49.90%)
# Likes: 579
# Dislikes: 27
# Total Accepted: 51.1K
# Total Submissions: 102.3K
# Testcase Example: '3\n[[0,1],[1,2],[2,0]]\... |
class HashMismatchError(Exception):
"""Occurs when a file does not have the expected hash."""
class DataUnavailableError(Exception):
"""Data is missing from disk and isn't readily available to easily download."""
class ShouldNeverHappenError(Exception):
"""Portions of code have been reached that the dev... |
'''
Desenvolva um programa que leia as duas notas de um aluno, calcule e mostre sua média.
'''
nota1 = float(input('Nota 1: '))
nota2 = float(input('Nota 2: '))
media = (nota1 + nota2) / 2
print('A media do aluno é {:.2f}'.format(media)) |
l = input()
T = len(l)
if(T <= 80):
print("YES")
else:
print("NO") |
# ler o comprimento de três retas e diga se elas podem ou não formar um triângulo
# r1 == r2 r2 == r1 r3 == r1
r1 = float(input('Reta 1: '))
r2 = float(input('Reta 2: '))
r3 = float(input('Reta 3: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r2 + r1:
print('É possível formar um triângulo')
if r1 == r2 == r3:
... |
#Entrada de dados.
frase = str(input('Digite uma frase: '))
#Processamento e saida de dados.
print(frase.replace(" ", ""))
|
"""
Entradas
(X,M)-->int-->valores
Salida
Nueva experiencia Monster-->int-->E
"""
#Caja negra 1
while True:
#Entrada
X , M= input().split()
#Caja negra 2
if(X=='0' and M=='0'):
break
#Salida
print(int(X)*int(M)) |
class Solution:
def maxProfit(self, prices: List[int]) -> int:
res = 0
for i in range(1,len(prices)):
if prices[i]>prices[i-1]:
res+=prices[i]-prices[i-1]
return res |
s = 'My Name is Pankaj'
# create substring using slice
name = s[11:]
print(name)
# list of substrings using split
l1 = s.split()
print(l1)
# if present or not
if 'Name' in s:
print('Substring found')
if s.find('Name') != -1:
print('Substring found')
# substring count
print('Substring count =', s.count('a')... |
# This problem was recently asked by Amazon:
# The h-index is a metric that attempts to measure the productivity and citation impact of the publication of a scholar.
# The definition of the h-index is if a scholar has at least h of their papers cited h times.
def hIndex(publications):
# Fill this in.
n = len... |
#
# PySNMP MIB module CISCO-ETHERNET-ACCESS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ETHERNET-ACCESS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:40:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.... |
class PythonListener(object):
def __init__(self, gateway):
self.gateway = gateway
def mapCollective(self, msg, harp_context):
harp_context.p(msg+1)
print(msg)
class Java:
implements = ["edu.iu.harp.boot.python.MapCollectiveReceiver"] |
#code
def subary(l,n,k):
cur_sum=l[0]
j=0
i=1
while i<n:
cur_sum+=l[i]
i+=1
while cur_sum>k:
cur_sum-=l[j]
j+=1
if cur_sum==k:
return [j+1,i]
return -1
for _ in range(int(input())):
n,k = map(int,input().split(... |
i=0
while i<10:
child=raw_input()
child=child.split()
child=[int(u) for u in child]
sum=child[0]+child[1]
if sum>0:
print(sum)
i=i+1
if (child[0] == 0 and child[1] == 0):
break
|
var = input ()
print("Hello, World." )
print (var)
|
def tileset_info(filename):
"""
Return the bounds of this tileset. The bounds should encompass the entire
width of this dataset.
So how do we know what those are if we don't know chromsizes? We can assume
that the file is enormous (e.g. has a width of 4 trillion) and rely on the
browser to pas... |
# The MIT License (MIT)
#
# Copyright (c) 2015 Christofer Hedbrandh
#
# 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 use, co... |
#!/usr/bin/env python3
#https://codeforces.com/problemset/problem/900/A
xs = [list(map(int,input().split()))[0] for _ in range(int(input()))]
np = sum([x>0 for x in xs])
nn = sum([x<0 for x in xs])
print('NO' if np>1 and nn>1 else 'YES')
|
# 面试题3:二维数组中的查找
# 题目:在一个二维数组中,每一行都按照从左到右递增的顺序排序,
# 每一列都按照从上到下递增的顺序排序。请完成一个函数,
# 输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
def findNum(matrix,num):
row,col = 0,len(matrix[0])-1
while row < len(matrix) and col >= 0:
if num == matrix[row][col]:
return True
elif num > matrix[row][col]... |
def question(a, bc, s):
exa = int(a)
exb, exc = map(int, bc.split())
exs = s
return f"{exa + exb + exc} {exs}"
|
def word_to_text_id(word):
return (word.text, int(word.id))
def filter_sent(sent, condition, postprocessor=word_to_text_id):
t = [w for w in sent.words if condition(w)]
if len(t) > 0:
return postprocessor(t[0])
else:
return None
def is_wh(word):
return word.xpos.startswith('W')
de... |
#leitura dos valores da entrada
valores = list(map(int,input().split()))
#cópia dos valores
listaOrdenada = valores[:]
#ordenar os valores
listaOrdenada.sort()
#saída dos valores em ordem crescente
for i in listaOrdenada:
print(i)
print()
#saída dos valores na ordem que foram inseridos
for c in valores:
prin... |
"""
Documentação de classes
Tempor duis sint irure ad duis est eiusmod. Duis eiusmod eu cupidatat occaecat ea eu cupidatat commodo ullamco ad excepteur. Magna laboris sunt reprehenderit sit cupidatat pariatur exercitation id veniam nulla voluptate culpa non cillum.
Veniam cupidatat ut mollit dolore. Elit enim elit an... |
class Solution:
def buildTree(self, inorder: List[int], postorder: List[int]) -> Optional[TreeNode]:
if not postorder or not inorder :
return None
root = TreeNode(postorder[-1])
m = inorder.index(root.val)
root.right = self.buildTree( inorder[m+1:] , postorder[m:-1] )
... |
class Pedido():
def __init__(self,cliente,valor,quantidade):
self._cliente = cliente
self._valor = valor
self._quantidade = quantidade
self._valor_total = 0
def get_valor(self):
return self._valor
def get_quantidade(self):
return self._qua... |
def generate_confluence_graph(
project, data, type='bar', x_axis='name',
exclude_metrics=['started_at'],
):
exclude_metrics.append(x_axis)
metric_names = []
for k in data[0]:
if k not in exclude_metrics:
metric_names.append(k)
html = ""
html += '''
<ac:structured-... |
# -*- coding: utf-8 -*-
"""
Constants and unclassified functions.
"""
MAPPING_ID_FIELD = 'mapped_id'
"""
The name of the mapping id column.
:type str
"""
|
s = 1201
n = s > 1200
print(n)
a = 5
b = 1
c = True
d = True
condicao = a > b and c or d
print(condicao)
|
"""Methods to help characterize or compare models & training"""
def count_parameters(model):
return sum(p.numel() for p in model.parameters() if p.requires_grad)
|
""" Base interpolator: a dummy class is derived by the different interpolator schemes """
class BaseInterpolator(object):
""" Base class for interpolation
It sets what can be expected as methods during the interpolation calls
"""
def __init__(self, osl, *args, **kwargs):
pass
def interp(... |
# https://leetcode.com/problems/ambiguous-coordinates/
#
# algorithms
# Medium (43.27%)
# Total Accepted: 5,726
# Total Submissions: 13,232
# beats 91.11% of python submissions
class Solution(object):
def ambiguousCoordinates(self, S):
"""
:type S: str
:rtype: List[str]
"""
... |
n=str(input('Digite o seu nome completo: ')).strip()
n1=n.split()
print('Seu primeiro nome é: {} '.format(n1[0]))
print('Seu último nome é: {} '.format(n1[len(n1)-1]))
#pra mostrar o último, peguei o comprimento do n1 e fiz -1 dentro dos colchetes de mostrar posição
|
class PerfilpageTests(SimpleTestCase):
def test_perfilpage_status_code(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
def test_perfilpage_url_name(self):
response = self.client.get(reverse('profile'))
self.assertEqual(response.status_code, 20... |
"""
Naechstes Haus
Um die Weihnachtsliefertouren noch besser zu machen, muss der
Weihnachtsmann wissen welche zwei Haeuser in einer Nachbarschaft
am naehesten aneinander liegen. Er hat also ein Liste von
Haeusern (die Nachbarschaft) und muss die beiden finden, die
am Naehesten beieinander sind, zB:
In der Nachbarscha... |
def tribonacci(signature, n):
accu = signature[0:n]
for i in range(3,n):
accu.append( sum(accu[i-3:i]) )
return accu |
#!/usr/bin/env python
ip_addr = input("Please enter IP address: ")
my_ip_list = ip_addr.split(".")
my_ip_list[-1] = 0
ip_binary = []
ip_binary.append(bin(int(my_ip_list[0])))
ip_binary.append(bin(int(my_ip_list[1])))
ip_binary.append(bin(int(my_ip_list[2])))
ip_binary.append(bin(int(my_ip_list[3])))
print()
print("{... |
#
# PySNMP MIB module Novell-LANalyzer-TR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Novell-LANalyzer-TR-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:31:56 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... |
#!/usr/bin/env python
# encoding: utf-8
"""
pascals_triangle.py
Created by Shengwei on 2014-07-03.
"""
# https://oj.leetcode.com/problems/pascals-triangle/
# tags: easy / medium, triangle, dp
"""
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
... |
LANGUAGE_CONFIG = {"language": "en", "locale": "en_CA"}
CUSTOM_ACTION_CONFIG = {"url": "http://0.0.0.0:8080/"}
NLP_CONFIG = {
"resolve_entities_using_nbest_transcripts": ["store_info.get_store_hours"]
}
DOMAIN_CLASSIFIER_CONFIG = {
"model_type": "text",
"model_settings": {"classifier_type": "logreg",},
... |
#funcao soma
def sum(a, b):
return a + b
c = sum(1, 3)
print("Somado: ", c)
|
class Snake():
def __init__(self, snake):
self.id = snake['id']
self.name = snake['name']
self.health = snake['health']
self.body = snake['body']
self.head = snake['head']
self.length = snake['length']
# self.head = self.coordinates[0]
# self.len... |
# CHECKING ARRAY IF IN SORTED ORDER
def checkSorted(n,A,i):
if i==n:
return 1
if A[i]>=A[i-1]:
return checkSorted(n,A,i+1)
else:
return 0
n = int(input("Enter number of elements :"))
Arr = [int(a) for a in input().split()]
if checkSorted(n,Arr,1):
print("Sorted")
el... |
temp = 120
if temp > 85:
print("Hot")
elif temp > 100:
print("REALLY HOT!")
elif temp > 60:
print("Comfortable")
else:
print("Cold") |
# -*- coding: utf-8 -*-
"""Top-level package for pfm."""
__author__ = """Takahiko Ito"""
__email__ = 'takahiko03@gmail.com'
__version__ = '0.6.0'
|
dict={}
a=[[1,['ocean','pondy','2']],[2,['xxx','yyy','zzz']]]
for i in a:
dict.update({i[0]:i[1]})
print(dict)
b=int(input('enter value '))
x=dict.get(b)
y=['name','place','age']
for i in range(len(y)):
print(y[i],':',x[i])
|
# Python program to print odd Numbers in a List
# list of numbers
list1 = [10, 21, 4, 45, 66, 93]
i = 0
# using while loop
while(i < len(list1)):
# checking condition
if list1[i] % 2 != 0:
print(list1[i], end = " ")
# increment i
i += 1
|
# -*- coding: UTF-8 -*-
# @Time : 04/08/2020 15:38
# @Author : QYD
# @FileName: tree.py
# @Software: PyCharm
class TreeNode(object):
def __init__(self, value, start_point_index):
self.value = value
self.start_point_index = start_point_index
self.child_list = []
def add_child(self, ... |
pm1_str = """A01 Negative Control
A02 L-Arabinose cpd00224
A03 N-Acetyl-DGlucosamine cpd00122
A04 D-Saccharic Acid cpd00571
A05 Succinic Acid cpd00036
A06 D-Galactose cpd00108
A07 L-Aspartic Acid cpd00041
A08 L-Proline cpd00129
A09 D-Alanine cpd00117
A10 D-Trehalose cpd00794
A11 D-Mannose cpd00138
A12 Dulci... |
"""
N
1^3 + 2^3 + 3^3 + ... + N^3
"""
n = int(input())
result = 0
for i in range(1, n + 1):
result = result + i ** 3
print(result)
|
def day_to_seconds(day):
return day * 24 * 60 * 60
def hour_to_seconds(hour):
return hour * 60 * 60
def seconds_to_hour(seconds):
return seconds / (60 * 60) |
#!/usr/bin/python
n = int(input())
res, count = 0, 2
for _ in range(n):
name = input()
if name.endswith('+one'):
count += 2
else:
count += 1
if count == 13:
count += 1
print(count * 100)
|
# =============================================================================
# TASK PARAMETER DEFINITION (should appear on GUI) init trial objects values
# =============================================================================
# SOUND, AMBIENT SENSOR, AND VIDEO RECORDINGS
RECORD_SOUND = True
RECORD_AMBIENT_SE... |
# 5. Реализовать структуру «Рейтинг», представляющую собой не возрастающий
# набор натуральных чисел. У пользователя необходимо запрашивать новый
# элемент рейтинга. Если в рейтинге существуют элементы с одинаковыми
# значениями, то новый элемент с тем же значением должен разместиться
# после них.
# Подсказка. Например... |
ENDPOINT_ARGUMENTS = {
'search_instruments': {
'projection': ['symbol-search', 'symbol-regex', 'desc-search', 'desc-regex', 'fundamental']
},
'get_market_hours': {
'markets': ['EQUITY', 'OPTION', 'FUTURE', 'BOND', 'FOREX']
},
'get_movers': {
'market': ['$DJI', '$COMPX', '$SPX... |
#
# PySNMP MIB module TC-GROUPS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TC-GROUPS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:08:02 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... |
#-------------------------------------------------------------------------------
# readstrings.py - A demonstration of while loops to validate user input
#-------------------------------------------------------------------------------
# (note the need for "len(string) == 0" to appear twice).
def getString1():
stri... |
# 创建列表,通过[]来创建列表
my_list = [] # 创建了一个空列表
# print(my_list , type(my_list))
# 列表存储的数据,我们称为元素
# 一个列表中可以存储多个元素,也可以在创建列表时,来指定列表中的元素
my_list = [10] # 创建一个只包含一个元素的列表
# 当向列表中添加多个元素时,多个元素之间使用,隔开
my_list = [10, 20, 30, 40, 50] # 创建了一个保护有5个元素的列表
# 列表中可以保存任意的对象
my_list = [10, 'hello', True, None, [1, 2, 3], print... |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2002-2019 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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
... |
"""This application overrides django-machina's forum_moderation app."""
# pylint: disable=invalid-name
default_app_config = (
"ashley.machina_extensions.forum_moderation.apps.ForumModerationAppConfig"
)
|
def insertion_sort(unsorted_list):
for index in range(1, len(unsorted_list)):
search_index = index
insert_value = unsorted_list[index]
while search_index > 0 and unsorted_list[search_index - 1] > insert_value:
unsorted_list[search_index] = unsorted_list[search_index - 1]
... |
test = {
'name': 'Problem 0',
'points': 0,
'suites': [
{
'cases': [
{
'answer': 'It represents the amount of health the insect has left, so the insect is eliminated when it reaches 0',
'choices': [
r"""
It represents armor protecting the insect, so the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.