content stringlengths 7 1.05M |
|---|
# REMISS
for i in range(int(input())):
A,B = map(int,input().split())
if A>B: print(str(A) + " " + str(A+B))
else: print(str(B) + " " + str(A+B)) |
#!/usr/bin/env python3
def hello(**kwargs):
print(f'Hello')
if __name__ == '__main__':
hello(hello())
|
#!/usr/bin/env python3
with open("dnsservers.txt", "r") as dnsfile:
for svr in dnsfile:
svr = svr.rstrip('\n')
if svr.endswith('org'):
with open("org-domain.txt", "a") as srvfile:
srvfile.write(svr + "\n")
elif svr.endswith('com'):
with open("com-dom... |
class Solution:
def sumOfLeftLeaves(self, root: TreeNode) -> int:
if not root:
return 0
res = 0
q = deque([root])
while q:
node = q.popleft()
if node.left:
if not node.left.left and not node.left.right:
res += no... |
"""
Sponge Knowledge Base
Remote API security
"""
def configureAccessService():
# Configure the RoleBasedAccessService.
# Simple access configuration: role -> knowledge base names regexps.
remoteApiServer.accessService.addRolesToKb({ "ROLE_ADMIN":[".*"], "ROLE_ANONYMOUS":["boot", "python"]})
# Simple... |
'''
Given a string s, the power of the string is the maximum length of a non-empty substring that contains only one unique character.
Return the power of the string.
Example 1:
Input: s = "leetcode"
Output: 2
Explanation: The substring "ee" is of length 2 with the character 'e' only.
Example 2:
Input: s = "abbcccddd... |
MAP_HEIGHT_MIN = 20
MAP_HEIGHT_MAX = 50
MAP_WIDTH_MIN = 20
MAP_WIDTH_MAX = 50
MAP_KARBONITE_MIN = 0
MAP_KARBONITE_MAX = 50
ASTEROID_ROUND_MIN = 10
ASTEROID_ROUND_MAX = 20
ASTEROID_KARB_MIN = 20
ASTEROID_KARB_MAX = 100
ORBIT_FLIGHT_MIN = 50
ORBIT_FLIGHT_MAX = 200
ROUND_LIMIT = 1000
def validate_map_dims(h, w):
ret... |
string = input().split(", ")
beggars = int(input())
beggars_list = []
for x in range(0, beggars):
temp = string[x::beggars]
for j in range(0, len(temp)):
temp[j] = int(temp[j])
beggars_list.append(sum(temp))
print(beggars_list) |
# python to locate 1 in a 2D array
#below save it into a dictionary
# python to locate 1 in a 2D array
def check_zero(array1):
d = {}
print("array index zeros at:")
for i in range(len(array1)):
index = [k for k, v in enumerate(array1[i]) if v == 0]
d[i] = index
#print(i, index)
... |
name = "Sharalanda"
age = 10
hobbies = ["draw", "swim", "dance"]
address = {"city": "Sebastopol", "Post Code": 1234, "country": "Enchantia"}
print("My name is", name)
print("I am", age, "years old")
print("My favourite hobbie is", hobbies[0])
print("I live in", address["city"])
|
class Solution(object):
def threeConsecutiveOdds(self, arr):
"""
:type arr: List[int]
:rtype: bool
"""
odds = 0
for a in arr:
if a % 2 == 1:
odds += 1
if odds >= 3:
return True
else:
... |
# Copyright (c) 2018 Javier M. Mellid <jmunhoz@igalia.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, copy, modif... |
#Create a list using []
a = [1,2,3,7,66]
#print the list using print() function
print(a)
#Access using index using a[0], a[1], ....
print(a[2])
#Changing the value of the list
a[0] = 777
print(a)
#We can create a list with items of different type
b = [77,"Root",False,6.9]
print(b)
#List Slicing
friends = ["Root","... |
singular = [
'this','as','is','thesis','hypothesis','less','obvious','us','yes','cos',
'always','perhaps','alias','plus','apropos',
'was','its','bus','his','is','us',
'this','thus','axis','bias','minus','basis',
'praxis','status','modulus','analysis',
'aparatus'
]
invariable = [ #frozen_li... |
class Solution(object):
def summaryRanges(self, nums):
"""
:type nums: List[int]
:rtype: List[str]
"""
range_list = []
for i in range(len(nums)):
if i > 0 and nums[i - 1] + 1 == nums[i]:
range_list[-1][1] = nums[i]
else:
... |
#BEGIN_HEADER
#END_HEADER
'''
Module Name:
MetaboliteAtlas
Module Description:
A web-based atlas to liquid chromatography–mass spectrometry (LCMS) data
'''
class MetaboliteAtlas:
#BEGIN_CLASS_HEADER
#END_CLASS_HEADER
def __init__(self, config): #config contains contents of config file in hash or
... |
class Config:
"""
General configuration parent class
"""
pass
api_key = 'a493e30f11b147d0ba67b15ca60c5e4c'
SECRET_KEY = '1234567890'
class ProdConfig(Config):
"""
Production
"""
pass
class DevConfig(Config):
"""
development
"""
DEBUG = True
|
grana = float(input("Informe a quantidade de dinherio: R$"))
dolar = 5.4
print(f" Dá pra comprar USS${grana / dolar} com o valor atual na sua carteira")
print(f"Cotação usada: {dolar}")
|
""" Technically, a every problem is a program; but not every program is a
problem.
This distinction only really matters if we introduce nodes for For loops
and whatnot.
Then the problem has 'program-like' constructs.
"""
|
"""
taskmaster.example
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
def get_jobs(last=0):
# last_job would be sent if state was resumed
# from a previous run
for i in xrange(last, 20000):
yield i
def handle_job(i):
pass
... |
#
# PySNMP MIB module JUNIPER-MOBILE-GATEWAY-SGW-GTP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-MOBILE-GATEWAY-SGW-GTP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:00:25 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using... |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
BAZEL_INSTALLER = struct(
revision = "4.0.0",
sha256 = "bd7a3a583a18640f58308c26e654239d412adaa833b6b6a7b57a216ab62fabc2",
)
DEBS_TARBALL = struct(
revision = "1608132805",
sha256 = "7ed2d4869f19c11d8c39345bd75f908a51410bf4e512e9fc368ad... |
if __name__ == '__main__':
n = int(input())
s = set()
for i in range (n):
s.add(input())
print((len(s)))
|
"""
Functions to anglicize integers in the range 1..19
This is a simple example for now. We will see a more complex
version of this later.
Author: Walker M. White
Date: March 30, 2019
"""
def anglicize(n):
"""
Returns: English equiv of n.
Parameter: the integer to anglicize
Precondition: n in 1.... |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def distanceK(self, root, target, K):
"""
:type root: TreeNode
:type target: TreeNode
:type K: int
... |
# -*- coding:utf-8 -*-
# @Time:2020/6/15 11:38
# @Author:TimVan
# @File:leetcode.py
# @Software:PyCharm
# Definition for singly-linked list.
# for j in range(10, 5, -1):
# print(j)
print('a'.find(' '))
|
# Spam filter
# Take a list of dishes from a menu and add “spam” to them. See https://en.wikipedia.org/wiki/Spam_(Monty_Python).
def main():
try:
dishCount = int(input('Enter number of dishes in menu > '))
dishes = [input(f'Enter Dish No.{i + 1} > ') for i in range(dishCount)]
dishes = [f'{dish} spam' ... |
arguments = ["self", "info", "args"]
helpstring = "lurk"
minlevel = 3
def main(connection, info, args) :
"""Deops and voices the sender"""
connection.rawsend("MODE %s -o+v %s %s\n" % (info["channel"], info["sender"], info["sender"]))
|
def main():
a = ["a", 1, "5", 2.3, 1.2j]
some_condition = True
for x in a:
# If it's all isinstance, we can use a type switch
if isinstance(x, (str, float)):
print("String or float!")
elif isinstance(x, int):
print("Integer!")
else:
print("... |
"""
Created By: Alex J. Gatz
Date: 06/07/2018
This is some code playing with the usage of a python
"Generator" which is really very cool. Another use case
I want to play with is properly ordering installation of
packages to ensure that if there are dependencies that they are installed in the proper order.
Created a... |
___assertIs(isinstance(True, bool), True)
___assertIs(isinstance(False, bool), True)
___assertIs(isinstance(True, int), True)
___assertIs(isinstance(False, int), True)
___assertIs(isinstance(1, bool), False)
___assertIs(isinstance(0, bool), False)
|
# -*- coding: utf-8 -*-
"""Top-level package for stocks."""
__author__ = """Jianye Xu"""
__email__ = 'jianye.xu.stats@gmail.com'
__version__ = '0.1.0'
|
"""
Replace With Alphabet Position
Welcome.
In this kata you are required to, given a string, replace every letter with its position in the alphabet.
If anything in the text isn't a letter, ignore it and don't return it.
"a" = 1, "b" = 2, etc.
Example
alphabet_position("The sunset sets at twelve o' clock.")
Should... |
# Copyright (c) 2013 Huan Do, http://huan.do
class Declaration(object):
def __init__(self, name):
self.name = name
self.delete = False
self._conditional = None
@property
def conditional(self):
assert self._conditional is not None
return self.delete or self._conditio... |
line = '-' * 30
print(line)
print('{:^30}'.format('LOJA SUPER BARATÃO'))
print(line)
total = more1000 = 0
productMaisBarato = ''
priceMaisBarato = 0
primeiraVez = True
while True:
name = str(input('Nome do produto: '))
price = float(input('Preço: R$'))
moreProducts = ' '
while moreProducts not in 'SN':
... |
DOMAIN = "yoosee"
PLATFORMS = ["camera"]
DEFAULT_NAME = "Yoosee摄像头"
VERSION = "1.1"
SERVICE_PTZ = 'ptz' |
"""
3.Question 3
In this programming problem you'll code up Prim's minimum spanning tree algorithm.
This file (edges.txt) describes an undirected graph with integer edge costs. It has the format
[number_of_nodes] [number_of_edges]
[one_node_of_edge_1] [other_node_of_edge_1] [edge_1_cost]
[one_node_of_edge... |
description = 'Verify the user can add an action to the teardown'
pages = ['common',
'index',
'tests',
'test_builder']
def setup(data):
common.access_golem(data.env.url, data.env.admin)
index.create_access_project('test')
common.navigate_menu('Tests')
tests.create_access_ra... |
def process(record):
ids = (record.get('idsurface', '') or '').split(' ')
if len(ids) > 4:
return {'language': record['language'],
'longitude': float(record['longitude'] or 0),
'latitude': float(record['latitude'] or 0),
'idsurface': ids}
|
"""
Challenge #1:
Write a function that retrieves the last n elements from a list.
Examples:
- last([1, 2, 3, 4, 5], 1) ➞ [5]
- last([4, 3, 9, 9, 7, 6], 3) ➞ [9, 7, 6]
- last([1, 2, 3, 4, 5], 7) ➞ "invalid"
- last([1, 2, 3, 4, 5], 0) ➞ []
Notes:
- Return "invalid" if n exceeds the length of the list.
- Return an emp... |
a = 2 ** 50
b = 2 ** 50 * 3
c = 2 ** 50 * 3 - 1000
d = 400 / 2 ** 50 + 50
print(a,b,c,d) |
# -*- encoding:utf-8 -*-
"""Autogenerated file, do not edit. Submit translations on Transifex."""
MESSAGES = {
"%d min remaining to read": "%d minutoj por legi",
"(active)": "(aktiva)",
"Also available in:": "Ankaŭ disponebla en:",
"Archive": "Arkivo",
"Atom feed": "",
"Authors": "Aŭtoroj",
... |
G = 6.67408e-11 # N-m2/kg2
#
# Normalize the constants such that m, r, t and v are of the order 10^1.
#
def get_normalization_constants_alphacentauri():
# Normalize the masses to the mass of our sun
m_nd = 1.989e+30 # kg
# Normalize distances to the distance between Alpha Centauri A and Alpha Centa... |
# Write a program that asks the user what kind of rental car they
# would like. Print a message about that car, such as “Let me see if I can find you
# a Subaru.”
car = input("What type of rental rental car would you like? ")
print(f"Checking database to find a {car}")
# Write a program that asks the user how many pe... |
"""
BFS
"""
class Solution909:
pass
|
# Time: 0.72 s
movies = []
for _ in range(int(input())):
movies.append(tuple(map(int, input().split())))
movies.sort(key=lambda x: x[1])
last_end_time = 0
movie_count = 0
for start_time, end_time in movies:
if start_time >= last_end_time:
last_end_time = end_time
movie_count += 1
print(movi... |
class angle_adjustclass(): #ステアリングの切れ角を調整する
def __init__(self):
self.angle_adjust = 1.0
return
def angleincrease(self):
self.angle_adjust = round(min(2.0, self.angle_adjust + 0.05), 2)
print("In angle_adjust increase",self.angle_adjust)
def angledecrease(self):
self... |
# 072220
# CodeSignal
# https://app.codesignal.com/arcade/intro/level-6/mCkmbxdMsMTjBc3Bm/solutions
def array_replace(inputArray, elemToReplace, substitutionElem):
# loop through input array
# if element = elemToReplace
# replace that element
for index,i in enumerate(inputArray):
if i == elemT... |
while True:
print('\n--- MULTIPLICATION TABLE ---')
num = int(input('Type a number integer: '))
if num < 0:
break
for c in range(1, 11):
print(f'{c} X {num} = {c*num}')
print('END PROGRAM') |
"""
2997. 네 번째 수
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 68 ms
해결 날짜: 2020년 9월 26일
"""
def main():
num = sorted(map(int, input().split()))
d1 = num[1] - num[0]
d2 = num[2] - num[1]
if d1 == d2: res = num[2] + d1
elif d1 > d2: res = num[0] + d2
else: res = num[1] + d1
print(re... |
def plot(width, height):
for j in range(height):
y = height - j - 1
print("y = {0:3} |".format(y), end="")
for x in range(width):
print("{0:3}".format(f(x,y)), end="")
print()
print(" +", end="")
for x in range(width):
print("---", end="")
prin... |
'''
Psuedo-joystick object for playback of recorded macros
'''
class PlaybackJoystick():
def __init__(self, playback_data):
self.playback_data = playback_data
self.t = 0
def setTime(self, t=0):
self.t = t
def getRawAxis(self, axis):
#TODO fix me, get correct index for ... |
default_app_config = "freight.apps.FreightConfig"
__version__ = "1.5.1"
__title__ = "Freight"
|
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may n... |
words_file = open('wordlist.txt')
print("export const VALIDGUESSES6 = [")
for word in words_file.read().split('\n'):
word = word.strip()
if word.isalpha() and len(word) == 6:
print(' "%s",' % word.lower())
print("];") |
graph = {}
n = input().split(' ')
node, edge, start = map(int, n)
for i in range(edge):
edge_number = input().split(' ')
n1, n2 = map(int, edge_number)
if n1 not in graph:
graph[n1] = [n2]
elif n2 not in graph[n1]:
graph[n1].append(n2)
if n2 not in graph:
graph[n2] = [... |
#
# PySNMP MIB module TPLINK-COMMANDER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TPLINK-COMMANDER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:16:55 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... |
def hello(name):
return 'Hello ' + 'name'
def test_hello():
assert hello('name') == 'Hello name' |
#!/usr/bin/env python
class MatrixUtil:
@classmethod
def allocateMatrix(cls, numRows, numCols):
rv = [0.0] * numRows
for i in range(numRows):
rv[i] = [0.0] * numCols
return rv
@classmethod
def allocateMatrixAsRowMajorArray(cls, numRows, numCols):
return [0.... |
with open("input.txt") as input_file:
lines = input_file.readlines()
result = 0
for line in lines:
print(line.strip(), result)
result += int(line.strip())
print(result)
|
#License: https://bit.ly/3oLErEI
def test(strs):
return [*map(len, strs)]
strs = ['cat', 'car', 'fear', 'center']
print("Original strings:")
print(strs)
print("Lengths of the said list of non-empty strings:")
print(test(strs))
strs = ['cat', 'dog', 'shatter', 'donut', 'at', 'todo', '']
print("\nOriginal string... |
#!/usr/bin/env python3
"""文件解析器,对dns分发的rules和白名单ip列表进行解析
文件格式:一条规则就是一行,#开头的表示注解:
"""
class FilefmtErr(Exception): pass
def __drop_comment(line):
"""删除注释"""
pos = line.find("#")
if pos < 0:
return line
return line[0:pos]
def __read_from_file(fpath):
result = []
fdst = open(fpath, "r... |
CANAIS_ADM = {
"diretoria": 441263190832185350,
"secretaria": 731689039853518848
}
SAUDACOES = ["Olá!", "Oi!", "Iai!"]
GUIA_ANONIMA_ID = 956319073568976967
msg_ajuda = "**::ola** | **::oi** | **::iai** | **::athena**: Mande um ola caloroso para mim, e responderei!\n" \
"**::cool** `texto`: Você po... |
# Write a Python program to compute the greatest common divisor (GCD) of two positive integers.
n1 = int(input("Enter the first number: "))
n2 = int(input("Enter the second number: "))
a1 = []
a2 = []
a3 = []
for i in range(1, n1 + 1):
if n1 % i == 0:
a1.append(i)
for i in range(1, n2 + 1):
if n2 % ... |
# Only used for PyTorch open source BUCK build
IGNORED_ATTRIBUTE_PREFIX = [
"apple",
"fbobjc",
"windows",
"fbandroid",
"macosx",
]
IGNORED_ATTRIBUTES = [
"feature",
"platforms",
]
def filter_attributes(kwgs):
keys = list(kwgs.keys())
# drop unncessary attributes
for key in ke... |
"""Hebrew Letter-Based Numering Identifiers and Quantifiers"""
def remove_chucks(hebrew_word) -> str:
""" Hebrew numbering systems use 'chuck-chucks' (aka quotation
marks that aren't being used to signify a quotation)
in between letters that are meant as numerics rather
than words. To mak... |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... |
# -*- coding: utf-8 -*-
class Solution:
def crackSafe(self, n, k):
if k == 1:
return '0' * n
s = self.deBrujin(n, k)
return s + s[:n - 1]
def deBrujin(self, n, k):
"""See: https://en.wikipedia.org/wiki/De_Bruijn_sequence#Algorithm"""
def _deBrujin(t, p):
... |
def media_suicida (mediaProvas, mediaTrabalhos):
if mediaProvas >= 5 and mediaTrabalhos >= 5:
return mediaProvas * 0.6 + mediaTrabalhos * 0.4
return min(mediaProvas, mediaTrabalhos)
notasProva = []
notasTrabalho = []
quantidadeProva = int(input("Quantidade de provas: "))
for item in range(quantidade... |
print('Begin', __name__)
print('Defines fA')
def fA():
print('Inside fA')
if __name__ == "__main__":
print('Calls fA')
fA()
print('End', __name__)
|
def find_missing_number(sequence):
try:
numbers = sorted(int(word) for word in sequence.split(" ") if word)
except ValueError:
return 1
return next((i + 1 for i, n in enumerate(numbers) if i + 1 != n), 0) |
# Lucas Reicher Prompt #3 - Coding Journal #1
def main():
# Uses formatted strings to output the required info (result & type)
# Adds floats
x = 1.342 # float
y = 3.433 # float
z = x + y # float
float_sum_string = "Addition: {0} + {1} = {2} with type = {3}".format(str(x),str(y),str(z)... |
"""
At infinite membrane resistance, the Neuron does not leak any current out,
and hence it starts firing with the slightest input current,
This shifts the transfer function towards 0, similar to ReLU activation (centered at 0).
Also, when there is minimal refractory time, the neuron can keep firing
at a high input cu... |
class Solution:
"""
@param k: The k
@param a: The A
@param b: The B
@return: The answer
"""
def addition(self, k, a, b):
result = ""
i = len(a) - 1
j = len(b) - 1
carry = 0
while i >= 0 and j >= 0:
summ = carry + ord(a[i]) - ord('0') + ord(... |
# OpenWeatherMap API Key
weather_api_key = "e1067d92d6b631a16363bf4db3023b19"
# Google API Key
g_key = "AIzaSyA4RYdQ1nxoMTIW854C7wvVJMf0Qz5qjNk"
|
# Processor for kompas-data-contents.txt
MIN_IDX = 100
contentfile = open('../data/kompas-data-contents.txt', 'r')
content_data = []
for line in contentfile:
content_data.append(line)
processed_contentfile = open('../data/kompas-data-contents-processed.txt', 'w+')
for id, content in enumerate(content_data):
... |
class DmsRequestError(Exception):
def __init__(self, error_message, status_code):
self.message = "Error requesting DMS API %s with code %s" \
% (error_message, status_code)
super(DmsRequestError, self).__init__(self.message)
|
class Keyword:
def __init__(self, keyword):
if keyword in ['add', 'find']:
self.value = keyword
else:
self.value = 'find'
|
"""Given a string containing only the characters x and y, find whether there are the same number of xs and ys.
balanced("xxxyyy") => true
balanced("yyyxxx") => true
balanced("xxxyyyy") => false
balanced("yyxyxxyxxyyyyxxxyxyx") => true
balanced("xyxxxxyyyxyxxyxxyy") => false
balanced("") => true
balanced("x") =... |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 28 10:15:21 2021
@author: CC-SXF
"""
|
# Desenvolva um programa que leia o comprimento de três retas
# e diga ao usuário se elas podem ou não formar um triângulo.
print("-=-" * 15)
print("Vamos analisar um triângulo...")
print('-=-' * 15)
r1 = float(input('Informe o primeiro segmento: '))
r2 = float(input('Informe o segundo seguimento: '))
r3 = float(inpu... |
# import datetime
# import logging
# logger = logging.getLogger(__name__)
# logger.setLevel(logging.INFO)
def run(event, context):
# current_time = datetime.datetime.now().time()
# name = context.function_name
# logger.info("Your cron function " + name + " ran at " + str(current_time))
return "hello ... |
# coding: utf-8
class RurouniException(Exception):
pass
class ConfigException(RurouniException):
pass
class TokenBucketFull(RurouniException):
pass
class UnexpectedMetric(RurouniException):
pass |
class ControlStyles(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the style and behavior of a control.
enum (flags) ControlStyles,values: AllPaintingInWmPaint (8192),CacheText (16384),ContainerControl (1),DoubleBuffer (65536),EnableNotifyMessage (32768),FixedHeight (64),FixedWidth (32),Opaque ... |
"""
how to create a class
a class is constructed through constructor
=> a class can be constructed through specific function called "__init__(self)"
"""
# let's create a Class
class Person:
"""
A class to create a person with the following attributes:
age, marks, phone, user_id, profession, goal
... |
# Write a program that reads a word and prints all substrings, sorted by length. For
# example, if the user provides the input "rum" , the program prints
# r
# u
# m
# ru
# um
# rum
word = str(input("Enter a word: "))
wordLen = len(word)
subLen = 1
start = 0
for i in range(wordLen):
star... |
x = 100
y = 50
print('x=', x, 'y=', y)
|
BASE_CASE = {
"model": {
"random_seed": 495279142,
"default_age_grid": "0 0.01917808 0.07671233 1 5 10 20 30 40 50 60 70 80 90 100",
"default_time_grid": "1990 1995 2000 2005 2010 2015 2016",
"add_calc_emr": "from_both",
"birth_prev": 0,
"ode_step_size": 5,
"m... |
#Write a function named "falling_distance" that accepts an object's falling time
#(in seconds) as an argument. The function should return the distance, in meters
#, that the object has fallen during the time interval.Write a program that
#calls the function in a loop that passes the values 1 through 10 as arguments
... |
"""Represent the command parameter strings."""
ARG_COMMAND = 'command'
ARG_ARGUMENT = 'argument'
ARG_COUNT = 'count'
ARG_CHANNEL = 'channel'
ARG_CLIENT = 'client'
ARG_GUID = 'guid'
ARG_CHANGELIST = 'cl'
ARG_DEV_CHANNEL = 'dev_channel'
ARG_QUEUE_WORKER_NUMBER = 'worker_number'
ARG_CALLBACK = 'callback'
ARG_PAYLOAD = 'pa... |
a=list(input().split(','))
st,num=[],[]
for i in a:
s1,n=i.split(':')
st.append(s1)
num.append(n)
print(st)
print(num)
for i in range(len(num)):
for j in range(i):
print(st[j])
|
"""
Discussion:
Because we have a facilitatory synapses, as the input rate increases synaptic
resources released per spike also increase. Therefore, we expect that the synaptic
conductance will increase with input rate. However, total synaptic resources are
finite. And they recover in a finite time. Therefore, at... |
GitHubTarballPackage ('mono', 'mono-basic', '3.0', 'a74642af7f72d1012c87d82d7a12ac04a17858d5',
configure = './configure --prefix="%{prefix}"',
override_properties = { 'make': 'make' }
)
|
# Description
# 中文
# English
# Given an array of integers, remove the duplicate numbers in it.
# You should:
# Do it in place in the array.
# Move the unique numbers to the front of the array.
# Return the total number of the unique numbers.
# You don't need to keep the original order of the integers.
# Have you met... |
# Asking for height and weight input
height = float(input("What is your height in meters: "))
weight = float(input("What is your weight in kilograms: "))
# Calculating BMI (formula is weight/height^2)
bmi = str(round(weight/(height ** 2), 2))
# Printing BMI
print("Your BMI is " + bmi)
|
# IMAGES #
# UI NAVIGATION #
img_addFriend = "add_friend.png"
img_allow = "allow.png"
img_allowFlash = "enableflash_0.png"
img_allowFlash1 = "enableflash_1.png"
img_allowFlash2 = "enableflash_2.png"
img_alreadyStarted = "alreadystarted.png"
img_alreadyStarted1 = "alreadystarted1.png"
img_backButton = "back_button.png... |
class EfficiencyMeasurement():
# input_voltage = None
# input_current = None
# output_voltage = None
# output_current = None
# input_power = None
# output_power = None
# loss_power = None
# efficiency = None
def __init__(self, input_voltage: float, input_current: float,
... |
class Y:
def __init__(self, v0):
self.v0 = v0
self.g = 9.81
def value(self, t):
return self.v0*t - 0.5*self.g*t**2
def formula(self):
return "v0*t - 0.5*g*t**2; v0=%g" % self.v0
|
"""
* Problem Description
*Suppose you are a university student and you need to pay 1536 dollars as a tuition fee.
*The college is offering a 10% discount on the early payment. How much money do you have to pay if you make an early payment?
*Task
*Create a variable named fee and assign 1536 to it.
*Create another ... |
"""
PASSENGERS
"""
numPassengers = 19216
passenger_arriving = (
(7, 4, 4, 3, 2, 1, 4, 2, 4, 2, 0, 0, 0, 7, 5, 8, 3, 7, 1, 3, 0, 1, 2, 1, 1, 0), # 0
(4, 7, 2, 3, 3, 1, 2, 5, 2, 1, 1, 0, 0, 6, 4, 4, 3, 2, 1, 5, 1, 1, 1, 0, 1, 0), # 1
(6, 4, 5, 6, 2, 1, 2, 4, 1, 1, 0, 0, 0, 11, 3, 6, 7, 7, 0, 3, 2, 1, 2, 0, 0, 0),... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.