content stringlengths 7 1.05M |
|---|
items = [{'id': 1, 'name': 'laptop', 'value': 1000},
{'id': 2, 'name': 'chair', 'value': 300},
{'id': 3, 'name': 'book', 'value': 20}]
def duplicate_items(items):
return [{key: value for key, value in x.items()} for x in items]
|
DEPS = [
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
]
# TODO(phajdan.jr): provide coverage (http://crbug.com/693058).
DISABLE_STRICT_COVERAGE = True
|
{
'name': 'eCommerce',
'category': 'Website/Website',
'sequence': 55,
'summary': 'Sell your products online',
'website': 'https://www.odoo.com/page/e-commerce',
'version': '1.0',
'description': "",
'depends': ['website', 'sale', 'website_payment', 'website_mail', 'website_form', 'website... |
# Copyright (c) 2021 Open Risk (https://www.openriskmanagement.com)
#
# 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... |
# -*- coding: utf-8 -*-
# @Author: Zeyuan Shang
# @Date: 2016-03-09 22:56:44
# @Last Modified by: Zeyuan Shang
# @Last Modified time: 2016-03-09 22:56:54
class Solution(object):
def minPatches(self, nums, n):
"""
:type nums: List[int]
:type n: int
:rtype: int
"""
... |
class Bola:
def __init__(self, cor, circunferencia, material):
self.cor = cor
self.circunferencia = circunferencia
self.material = material
def troca_cor(self, n_cor):
self.cor = n_cor
def mostrar_cor(self):
return self.cor
bola = Bola('preta', 25,'couro')
print(b... |
soma = 0
for i in range(100):
num = i + 1
print(num)
soma += num ** 2
print(soma)
|
# Created by MechAviv
# Dice Master Damage Skin | (2437274)
if sm.addDamageSkin(2437274):
sm.chat("'Dice Master Damage Skin' Damage Skin has been added to your account's damage skin collection.")
sm.consumeItem() |
BUF_SIZE = 1024
ENABLE_DEBUG = True
IP_ADDR = '127.0.0.1'
REQ_NET_NAME = '/api/netname/'
REQ_IXP_NETS = '/api/ixnets/'
REQ_IXPS = '/api/ix/'
def printDebug(dbgMsg):
'''
Funcao auxiliar para depuracao.
'''
if ENABLE_DEBUG:
print('[dbg]', dbgMsg)
|
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( s , c ) :
oneSeen = False
i = 0
n = len ( s )
while ( i < n ) :
if ( s [ i ] == c ) :
... |
"""
The rust_toolchain rule definition and implementation.
"""
def _rust_toolchain_impl(ctx):
compilation_mode_opts = {}
for k, v in ctx.attr.opt_level.items():
if not k in ctx.attr.debug_info:
fail("Compilation mode {} is not defined in debug_info but is defined opt_level".format(k))
... |
richtige_eingabe = False
while not richtige_eingabe:
try:
# Inhaltliche Prüfung der Variablen
a = int(input("Bitte geben Sie eine Zahl ein: "))
b = int(input("Bitte geben Sie eine zweite Zahl ein: "))
if a > b:
print(a, "ist größer als", b)
richtige_eingabe =... |
#!/usr/bin/env python3
"""Infoset setup.
Manages parameters required by all classes in the module.
"""
# Main python libraries
def main():
"""Process data.
Args:
None
Returns:
None
"""
# Check the environment
pass
if __name__ == 'infoset':
main()
|
del_items(0x80082E48)
SetType(0x80082E48, "int GetTpY__FUs(unsigned short tpage)")
del_items(0x80082E64)
SetType(0x80082E64, "int GetTpX__FUs(unsigned short tpage)")
del_items(0x80082E70)
SetType(0x80082E70, "void Remove96__Fv()")
del_items(0x80082EA8)
SetType(0x80082EA8, "void AppMain()")
del_items(0x80082F6C)
SetType... |
#!/usr/bin/python3.8
#LEBG- Local, Enclosing, Global, Built-in
x = "Global x"
def outer():
# global x
x = "Local x"
def inner():
nonlocal x #cant use global variables as nonlocal in nested function
x = "Nonlocal x"
print(x)
print(x)
inner()
print(x)
print(x)
outer(... |
# Day 2: http://adventofcode.com/2016/day/2
# Problem:
# Given the following directions (on lines), start at the number 5 on a normal
# 9-key pad and move, when possible, one space in the desired direction until
# the line ends. That is the number for that line. For the next line, start
# at the previous line's endpoin... |
'''
Problem statement: We need to find the area difference between the squares where for one square circle is a circumcircle and the other one is incircle
Problem Link: https://edabit.com/challenge/NNhkGocuPMcryW7GP
'''
def square_areas_difference(r):
return 2*r*r
|
load(
"//kotlin/internal:defs.bzl",
_TOOLCHAIN_TYPE = "TOOLCHAIN_TYPE",
)
def _restore_label(l):
"""Restore a label struct to a canonical label string."""
lbl = l.workspace_root
if lbl.startswith("external/"):
lbl = lbl.replace("external/", "@")
return lbl + "//" + l.package + ":" + l.n... |
"""
출처: https://www.acmicpc.net/problem/5086
"""
def multiple_and_factor(n1: int, n2: int) -> str:
if n2 % n1 == 0:
return "factor"
elif n1 % n2 == 0:
return "multiple"
else:
return "neither"
if __name__ == '__main__':
while True:
a, b = map(int, input().split())
... |
class LockboxError(Exception):
pass
class LockboxDefinitionError(LockboxError):
'''Base exception for problems related to the actual definition of a
new lockbox record.
'''
pass
class LockboxParseError(LockboxError):
'''Base exception for problems related to reading a BAI Lockbox
record.... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
""" Describes Production cellular model. """
__author__ = 'Ari Saha (arisaha@icloud.com)'
__date__ = 'Tuesday, March 6th 2018, 10:08:50 am'
|
########################## DIRECTORIES ##########################
save_folder = "saved_data"
export_folder = "export_data" |
def reverse_and_mirror(s1, s2):
swap = s1.swapcase()
return '{}@@@{}{}'.format(s2[::-1].swapcase(), swap[::-1], swap)
# PEP8: function name should use snake_case
reverseAndMirror = reverse_and_mirror
|
"""
Physical constants in SI units.
"""
PLANCK = 6.62607004e-34 # (m2 kg s-1)
LIGHT = 299792458.0 # (m s-1)
BOLTZMANN = 1.38064852e-23 # (m2 kg s-2 K-1)
GRAVITY = 6.67408e-11 # (m3 kg−1 s−2)
PARSEC = 3.08567758147e16 # (m)
AU = 149597870700.0 # (m)
M_JUP = 1.89813e27 # (kg)
R_JUP = 69911000.0 # (m)
L_SUN = 3.8... |
'''
Brightness
==========
This API helps you to control the brightness of your primary display screen.
The :class:`Brightness` provides access to public methods to control the
brightness of screen.
NOTE:: For Android, make sure to add permission, WRITE_SETTINGS
Simple Examples
---------------
To know the current br... |
"""
bbofuser
FILE: __init__.py
Created: 8/4/15 11:35 PM
"""
__author__ = 'Mark Scrimshire:@ekivemark'
|
__all__ = ['baidusearch',
'bingsearch',
'bufferoverun',
'crtsh',
'certspottersearch',
'dnssearch',
'dogpilesearch',
'duckduckgosearch',
'exaleadsearch',
'githubcode',
'googlesearch',
'huntersearch',
... |
def min_fine(N: int, times: list[int], fines: list[int]):
weights: list[tuple[float, int]] = []
for i in range(N):
weight = fines[i]/times[i]
weights.append((weight, i))
weights = sorted(weights, reverse=True)
time = 0
delay = 0
fine = 0
for weight in weights:
time... |
# @author Huaze Shen
# @date 2019-11-06
def is_interleave(s1, s2, s3):
if len(s1) + len(s2) != len(s3):
return False
n1 = len(s1)
n2 = len(s2)
dp = [[False for i in range(n2 + 1)] for j in range(n1 + 1)]
dp[0][0] = True
for i in range(1, n1 + 1):
if dp[i - 1][0] and s1[i - 1] =... |
# SPDX-License-Identifier: Apache-2.0
"""
An example console application that uses the subarulink package.
For more details about this api, please refer to the documentation at
https://github.com/G-Two/subarulink
"""
|
#
# PySNMP MIB module CADANT-CMTS-DNSCLIENT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CADANT-CMTS-DNSCLIENT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:27:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.... |
def can_build(env, platform):
return env["tools"]
def configure(env):
pass
|
# -*- coding: utf-8 -*-
LOGGING = {
'version': 1,
#'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(asctime)s [%(process)d][%(levelname)s] %(module)s,%(funcName)s,%(lineno)s:%(message)s'
}, #, %(thread)d, %(name)s,
... |
# clp/cp/__init__.py
""" Tools for computer language processing. """
__version__ = '0.1.14'
__version_date__ = '2018-03-21'
__all__ = ['CLPError',
'serialize_str_list']
class CLPError(RuntimeError):
""" Errors encountered in processing computer language. """
pass
def serialize_str_list(name, in... |
"""
Import as 'oscccan'
"""
__all__ = [
'canbus',
]
class OsccModule(object):
"""
Wrapper to CAN data specific to an OSCC module. Used with CanBus class to
communicate on the OSCC CAN bus.
"""
def __init__(self, base_arbitration_id, module_name=None):
"""
Initialize CAN data ... |
valor = []
par = []
impar = []
while True:
valor.append(int(input('Digite um numero:')))
r = str(input('Quer Continuar?[S/N]:'))
if r not in 'Ss':
break
print(f'Lista {valor}')
for c in valor:
if c % 2 == 0:
par.append(c)
else:
impar.append(c)
print(f'Os numero pares são {par... |
N = int(input())
ARRAY = []
while N != 0:
A = input().split()
if len(A) == 3:
B = int(A[1])
C = int(A[2])
elif len(A) == 2:
B = int(A[1])
if A[0] == "insert":
ARRAY.insert(B, C)
elif A[0] == "print":
print(ARRAY)
elif A[0] == "remove":
ARRAY.re... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def splitListToParts(self, head: Optional[ListNode], k: int) -> List[Optional[ListNode]]:
output = []
node, length = head, 0... |
SERVER = "__SERVER__"
HELLO_INTERVAL = __HELLO_INTERVAL__
IDLE_TIME = __IDLE_TIME__
MAX_FAILED_CONNECTIONS = __MAX_FAILED_CONNECTIONS__
PERSIST = __PERSIST__
HELP = """
<any shell command>
Executes the command in a shell and return its output.
upload <local_file>
Uploads <local_file> to server.
download <url> <destin... |
def test():
__msg__.good(
"Nice work! Check the solution."
)
|
#!/usr/bin/env python
for _ in range(5):
print("Hello, World!")
|
def palindrome(text):
list_letters = list(text)
list_letters = list_letters[::-1]
new_text = ''.join(list_letters)
return new_text == text |
# Dicionários
# dados = dict()
# ou
# dados = {}
# dados = {'nome':'Pedro', 'idade':25}
# print(dados[nome])
# dados['sexo'] = 'M' - adicionar novo elemento
# del dados['idade'] - eliminar elemento
# filme = {'titulo':'Star Wars',
# 'ano':1977,
# 'diretor':'George Lucas'}
# print(filme.values()) - retornar todos os val... |
##Collect data:
#SMI: 2021/10/29
# create proposal: proposal_id('2021_3', '30000_YZhang_XZ') #create the proposal id and folder
# create proposal: proposal_id('2021_3', '30000_YZhang_Nov') #create the proposal id and folder
# create proposal: proposal_id('2021_3', '307961_Dinca') #create the proposal id ... |
'''
LISTAS SÃO MUTAVEIS
'''
print('-'*20)
lista=[1,2,3,4]
print(lista)
print('-'*20)
lista.append(5)
print(lista)
print('-'*20)
# Adicioan o 6 na posição 0
lista.insert(0,6)
print(lista)
print('-'*20)
# Se quiser remover pela posição/indice use o del ou pop
# Se quiser remover um valor especifico use o remove
del list... |
"""
Defined Washington State Leaf Data Systems dataset fields.
Cannabis Data Science Meetup Group
Copyright (c) 2022 Cannlytics
Authors: Keegan Skeate <keegan@cannlytics.com>
Created: 1/18/2022
Updated: 1/19/2022
License: MIT License <https://opensource.org/licenses/MIT>
"""
#-----------------------------------------... |
# coding=utf-8
# Marcelo Ambrosio de Goes
# marcelogoes@gmail.com
# 2022-03-25
# 100 Days of Code: The Complete Python Pro Bootcamp for 2022
# Day 39 - Flight Deal Finder
class FlightData:
def __init__(self, price, origin_city, origin_airport, destination_city, destination_airport, out_date, return_date):
... |
def publish_release(source, config, target):
"""
Publish a new release as a Docker image
This is a mock implementation used for unit tests
"""
return None
|
def check_prime(number):
# remove pass and write your logic here. if the number is prime return true, else return false
if(number > 1):
for each in range(2, number):
if(number % each) == 0:
return False
return True
return False
def rotations(num):
# remove p... |
class TestResult:
def __init__(self):
self.runCount = 0
self.errorCount = 0
def testStarted(self):
self.runCount = self.runCount + 1
def testFailed(self):
self.errorCount = self.errorCount + 1
def summary(self):
return '%d run, %d failed' % (self.runCount, sel... |
class Solution(object):
def __init__(self):
self.ans = ""
def DFS(self, node, visited, k):
for num in map(str, range(k)):
nodeCur = node + num
if nodeCur not in visited:
visited.add(nodeCur)
self.DFS(nodeCur[1:], visited, k)
... |
def isPalindrome(s):
return s == s[::-1]
def test_answer():
assert isPalindrome("software engineering gnireenigne erawtfos") == True
assert isPalindrome("HomeWork 2 Github Homework") == False
assert isPalindrome("reviver") == True
assert isPalindrome("Group12orG") == False
assert isPalindrome("wasitacatisaw"... |
# 伽罗华域
'''
输入:伽罗华域位大小4、8、16、32、64
输入:两个数字
输出:四则远算的结果
'''
primitive_polynomial_dict = {
4: 0b10011, # x**4 + x + 1
8: (1 << 8) + 0b11101, # x**8 + x**4 + x**3 + x**2 + 1
16: (1 << 16) + (1 << 12) + 0b1011, # x**16 + x**12 + x*... |
class Serializable:
@classmethod
def from_json(cls, obj):
return cls(**obj)
def __str__(self):
s = F'{type(self).__name__} @ {id(self)}\n'
for k, v in self.__dict__.items():
s += F'{k} -> {v}\n'
return s
def print_tree(obj, indent=2):
if type(obj) in (b... |
getting_started = {
'title': 'Getting Started',
'questions': [
{
'q': 'How does HDX define humanitarian data?',
'a': 'We define humanitarian data as: '
'<ol>'
'<li> data about the context in which a humanitarian crisis is occurring (e.g., baselin... |
def counting_sort(A, k):
C = [ 0 for _ in range(k+1) ]
B = [ 0 for _ in A ]
assert(len(C) == k+1)
assert(len(B) == len(A))
for j in A:
C[j] += 1 # C[i] now contains the number of elements equal to i.
for i in range(1, k+1):
C[i] = C[i] + C[i-1] # C[i ]now contains the n... |
# 005_Antecessor_e_sucessor.py
# Recebe um núro e exibe na tela seu antecessor e seu sucessor
num = int(input("Entre com um número: "))
antecessor = num-1
sucessor = num+1
print()
print(f"O antecessor de {num} é {antecessor} e o sucessors de {num} é {sucessor}") |
# Space: O(n)
# Time: O(n)
class Solution:
def sequentialDigits(self, low, high):
sequence = '123456789'
res = []
start_length = len(str(low))
end_length = len(str(high))
for length in range(start_length, end_length + 1):
for i in range(len(sequence)):
... |
def moneyput(text):
valid = False
while not valid:
input_ = input(text).replace(',', '.').strip()
if input_.isalpha() or input_ == '':
print('\033[31mERROR! Value not monetary.\033[m')
else:
valid = True
return float(input_)
def floatput(text):
"... |
# This Python file uses the following encoding: utf-8
# Section 2. Higher order functions and list comprehension
#
# According to Wikipedia, high-order-functions are functions that do at least one
# of the following:
#
# Take one or more functions as input.
# Output a function.
#
# In python, there are several exa... |
class Solution:
def minOperations(self, nums: List[int]) -> int:
cm = nums[0]
i = 1
ops = 0
while i < len(nums):
if nums[i] > cm:
cm = nums[i]
i += 1
else:
cm += 1
ops += cm - num... |
r = range(0, 30)
print(type(r))
print(type(10))
print(type('a'))
print(type("Hi there"))
class Car:
pass
class Truck():
pass
c = Car()
convert = Car()
t = Truck()
print(type(c))
print(type(t))
print(type(c) == type(t))
print(type(c) == type(convert))
print(isinstance(c, Car))
print(isinstance(t, Car))
if i... |
# -*- coding: utf-8 -*-
""" anydo.lib.error """
class AnyDoAPIBinderError(Exception):
"""An AnyDoAPIBinder error occured."""
def __init__(self, msg):
super(AnyDoAPIBinderError, self).__init__(msg)
self.msg = msg
def __str__(self):
return self.msg
|
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def swapPairs(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
# dummy data at the beginning of h... |
# -*- coding: utf-8 -*-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'TIMEOUT': 36000,
'KEY_PREFIX': 'post-office',
},
'post_office': {
'BACKEND'... |
b, n, m = map(int, input().split())
keyboards = list(map(int, input().rstrip().split()))
drives = list(map(int, input().rstrip().split()))
most_expensive = -1
for i in range(len(keyboards)):
for j in range(len(drives)):
if most_expensive < keyboards[i]+drives[j] and keyboards[i]+drives[j] <= b:
... |
"""
This is a cost that's able to train the circuit when the output is a measurement of a swap test.
"""
def fid_func(output):
# Implemented as the Fidelity Loss
# output[0] because we take the probability that the state after the
# SWAP test is ket(0), like the reference state
fidelity_loss = 1 / out... |
module_var = 12
def module_function():
print(module_var)
# module_var = 13
# print(module_var)
class MyClass():
def method(self):
print(module_var)
# module_var = 13
# print(module_var)
"""
-> As long as access to a module variable is only reading, it can be accessed
just ... |
clothes_in_the_box = [int(_)for _ in input().split()]
rack_capacity = int(input())
rack_count = 0
while len(clothes_in_the_box) > 0:
current_rack = 0
while current_rack <= rack_capacity:
current_clothes = clothes_in_the_box[-1]
if current_rack + current_clothes <= rack_capacity:
cu... |
INPUT = [
"FBFFBFFRLL",
"BFFBFBBLRR",
"FFFBFBFLLR",
"BBFFFBBRRR",
"FBFFFFBLLR",
"BFFFFBFRLL",
"FBBFFBBRRL",
"BFBBBBFLLR",
"BBBFFFBLLL",
"BBFFFBBLRL",
"FFFBFFFLRL",
"FFBFBBBLRL",
"FFFBBBBLRL",
"BFFBBBFRLR",
"FBFFBFBLLR",
"BBBFBBFLRL",
"BFFBBFBLLR",
... |
#!usr/bin/env python
a="Vivo en Madrid"
for i in a:
print(i)
|
def sum(x,y):
total=x+y
print(total)
a=3
b=6
operation = sum
print(operation(a,b))
|
# 替换空格
# 请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
class Solution:
# s 源字符串
def replaceSpace(self, s):
return s.replace(' ', '%20')
def replaceSpace2(self, s):
strLen = len(s)
aaa = []
for i in range(0, strLen):
if s[i] == " ... |
'''
Give an example of a software application in which adaptability can mean
the difference between a prolonged lifetime of sales and bankruptcy
The point of sales system that wont be able to change tax rate
''' |
def function_scope():
number1 = 56
string1 = "Hello, I am scoped string1 variable in side function"
print("I am local number1 variable inside function: " + str(number1))
print(string1)
number1 = 24
string1 = "Hello, I am global string1 variable"
print("I am global number1 variable : " + str(number1)... |
class Carro:
_cor = ''
_potenciaMotor = ''
_qtdPortas = 0
def setCor(self, cor):
self._cor = cor
def setPotenciaMotor(self, potenciaMotor):
self._potenciaMotor = potenciaMotor
def setQtdPortas(self, qtdPortas):
self._qtdPortas = qtdPortas
def getCor(... |
USED_SEED = 21
NUM_EXECUTIONS = 10
POPULATION_SIZE = [50, 100]
ITERATION_NUM = [20, 50, 100]
MIN_POS = -512
MAX_POS = 512
# 15% of the min and max positition
MIN_SPEED = -77
MAX_SPEED = 77
'''
The following values are proposed by Shi and Eberhart(1998), those values had presented good results in
general.
... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode:
"""
Assume there is an intersection, the distance between
headA ... |
#
# PySNMP MIB module TIMETRA-SAS-SYSTEM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TIMETRA-SAS-SYSTEM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:15:00 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (d... |
# -*- coding: utf-8 -*-
# Neste código o texto é registrado na variável "s". Usando a função "maketrans()" é possível fazer uma tabela de
# tradução, em que o string "@&!*#" representa os caracteres que serão substituídos pelos caracteres do string
# "aeiou". A substituição é feita na ordem do string, ou seja "@" sign... |
x = int(input("Введите натуральное число: "))
n = ""
while x > 0:
y = str(x % 2)
n = y + n
x = int(x / 2)
print(y, n, x)
print(n) |
TEXT = 'TX'
MARKDOWN = 'MD'
HTML = 'HT'
FORMATS = (
(MARKDOWN, 'Markdown'),
(TEXT, 'Plain text'),
(HTML, 'HTML')
)
DEFAULT = MARKDOWN
|
# enumeración exhaustiva
def enumeracion_exhaustiva(objetivo):
respuesta = 0
while respuesta**2 < objetivo:
respuesta += 1
if respuesta**2 == objetivo:
return f'La raíz cuadrada de {objetivo} es {respuesta}'
else:
return f'{objetivo} no tiene una raíz cuadrada exacta'
|
#!/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
# EASY-INSTALL-SCRIPT: 'Pillow==2.8.1','pilfont.py'
__requires__ = 'Pillow==2.8.1'
__import__('pkg_resources').run_script('Pillow==2.8.1', 'pilfont.py')
|
begin_unit
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/L... |
sample = ['bob', 7, 'joe']
test = "BOB"
print("joe" not in sample)
print(test.lower() in sample)
print(3 > 1 and 2*3 == 5)
print(2<=1 or 3-2 == 1)
|
#!/usr/bin/env python3
# HAGrid Version
__version__ = "0.1.8"
if __name__ == "__main__":
print(__version__)
|
'''
Rock, Paper, Scissors
'''
print('Hell and welcome to the rock, paper, scissors game!')
|
# FLOW014
for i in range(int(input())):
h,c,t=map(float,input().split())
if h>50 and c<0.7 and t>5600: print("10")
elif h>50 and c<0.7: print("9")
elif c<0.7 and t>5600: print("8")
elif h>50 and t>5600: print("7")
elif h>50 or c<0.7 or t>5600: print("6")
else: print("5") |
class C:
def f(self): pass
f1 = C.f
c = C()
f2 = c.f
|
# Your Datadog API Key
API_KEY = ""
# Your Datadog Application Key
APP_KEY = ""
# A list of metric names, values should match metrics present in your account
METRICS_TO_EVAL = ["system.cpu.user", "system.disk.in_use"]
### ADVANCED CONFIGS
# the filename where dashboard api responses are stored to avoid duplicate re... |
the_count = [1, 2, 3, 4, 5]
fruits = ['apples', 'oranges', 'pears', 'apricots']
change = [1, 'pennies', 2, 'dimes', 3, 'quarters']
# this first kind of for-loop goes through a list
for number in the_count:
print(f"This is count {number}")
# same as above
for fruit in fruits:
print(f"A fruit of type: {fruit}"... |
__all__ = ['MQTT_API_KEY',
'MQTT_WRITE_API_KEY',
'CHANNEL',
'wifi_ssid',
'wifi_pw']
MQTT_API_KEY = ""
MQTT_WRITE_API_KEY = ""
CHANNEL = ""
wifi_ssid = ''
wifi_pw = ''
|
class Settings:
def __init__(self):
"""Stores all the settings"""
# Weather settings
self.WEATHER_TOKEN = 'AEelEAvZsbohTPic5CXFS2hXaL1QUatV'
self.weather_language = 'de-de'
self.weather_city = 'Brixen'
# data settings
self.directory_path = 'weather_data'
... |
# this segment tree will support two operations:
# 1. apply min or max with value h on interval [r, v)
# 2. find min of elements in interval [r, l)
# For our lazy updates we will keep pairs [h_max, h_min], where
# operation max was applied with h_max and min with h_min. It can be proven
# that we always can keep pairs ... |
zbr = "bar"
assert zbr
|
class Solution:
"""
@param a: An integer
@param b: An integer
@return: The sum of a and b
"""
def aplusb(self, a, b):
# write your code here
return a + b
|
#Faça um programa que leia um número Inteiro qualquer e mostre na tela a sua tabuada(usando enquanto)
v = int(input(" digite um valor para ter sua tabuada: "))
n = 1
while n<11:
print("{} x {} = {} ".format(v,n,v*n))
n = n+1 |
DEFAULT_STATUS_CODE = 400
DB_DEFAULT_STATUS_CODE = 500
NOT_FOUNT_STATUS_CODE = 404
UNAUTHORIZED_STATUS_CODE = 401
DB_NAME = "users"
DB_USER = "root"
DB_PASSWORD = "test123"
|
"""
Exercício 14
Nome: Média Escolar
Objetivo: Escrever uma aplicação utilizando funções que calcule a média de um aluno.
Dificuldade: Intermediário
1 - Um professor, muito legal, fez 3 provas durante um semestre mas só vai levar em conta as duas
notas mais altas para calcular a média.
2 - Faça uma aplicação que peça ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.