content stringlengths 7 1.05M |
|---|
algorithm = "fourier"
potential = "quadratic"
T = 12
dt = 0.01
eps = 0.1
f = 2.0
ngn = 4096
basis_size = 4
P = 1.0j
Q = 1.0
S = 0.0
parameters = [ (P, Q, S, 0.0, 1.0) ]
coefficients = [[(0, 1.0)]]
write_nth = 2
|
STEP = 'step'
RESET = 'reset'
START = 'start'
CLOSE = 'close'
ACTION_SPACE = 'action_space'
OBSERVATION_SPACE = 'observation_space'
REWARD_RANGE = 'reward_range'
METADATA = 'metadata'
CHANGE_CAMERAS = 'change_cameras'
|
r, c = int(input()), int(input())
rows = [0] * r
columns = [0] * c
for _ in range(int(input())):
rc, i = input().split()
if rc == 'R':
rows[int(i) - 1] += 1
else:
columns[int(i) - 1] += 1
n = 0
for q in rows:
for w in columns:
n += 1 if (w + q) % 2 else 0
p... |
# 1111
# 2222
# 3333
# 4444
print()
n=int(input("Enter the value n "))
i=1
while i<=n:
j=1
while j<=n:
print(i,end="")
j=j+1
print()
i=i+1 |
class Move:
def __init__(self, move_id=-1, response_type="", template=[], blanks=[], blank_index=[], type_num=-1, subject=None):
self.move_id = move_id
self.type = type
self.template = template
self.blanks = blanks
self.response_type = response_type
self.blank_index ... |
admin = """
<!doctype html>
<html lang="en">
<head>
<title>Library Registry</title>
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
<link href=\"/static/registry-admin.css\" rel="stylesheet" />
</head>
<body>
<script src=\"/static/registry-admin.js\"></script>
<script>
var registryAdmin... |
# print subset/powerset
# sample output:
# 123
# 12
# 13
# 1
# 23
# 2
# 3
def subset(s, index, holder):
if index == len(s):
print(holder)
return
subset(s, index+1, holder + s[index])
subset(s, index+1, holder)
s= "123"
holder=""
index = 0
subset(s, index, holder) |
""" 该代码改编自PyTorch官网torchvision源代码
https://github.com/pytorch/vision/blob/master/torchvision/models/segmentation/fcn.py
"""
# FCN特征提取部分
def _segm_resnet(name, backbone_name, num_classes, aux,
pretrained_backbone=True):
backbone = resnet.__dict__[backbone_name](
pretrained=pretrained_backbone,
... |
''' Module that stores the constants for the program '''
NPE_REWARDS = {
'npe_rewards_login_v1_step1': {'database_name': 'day_1_status'},
'npe_rewards_login_v1_step2': {'database_name': 'day_2_status'},
'npe_rewards_login_v1_step3': {'database_name': 'day_3_status'},
'npe_rewards_login_v1_step4': {'dat... |
def foo(a, b):
pass
foo(2, 1)
foo(2, b=1)
|
globalVariables={'jsondata':'','path':''} #it holds variables during runtime for collaboration across modules
proxies = {'http': 'http://0.0.0.0:8080', 'https': 'http://0.0.0.0:8080'}
tags = ('html', 'd3v', 'a', 'details') # HTML Tags
badTags = ('iframe', 'title', 'textarea', 'noembed',
'style', 'templat... |
add = 0
index = 1
while True: # fist the program need check is condicion is true#
insert = int(input(" calc the average that Number's %d press 0 for exit ."%index))
if insert == 0:
break
add = add + insert
index = index + 1
print (" Average (%d)" % (add/index))
''' this joker %d
show's t... |
class LabelSettings(object):
@property
def INSTALLED_APPS(self):
return super().INSTALLED_APPS + ['labels']
default = LabelSettings
|
class Solution:
# @paramn n: An integer
# @return: An integer
def numTrees(self, n):
# write your code here
count = [0] * (n+1)
count[0] = 1
count[1] = 1
for i in xrange(2, n+1):
for j in xrange(i):
count[i] += count[j] * count[i-j-1]
return... |
x = 9
y = 3
# Arithmetic Operators
print(x+y) #Addition
print(x-y) #Subtraction
print(x*y) #Multiplication
print(x/y) #Division
print(x%y) #Modulus
print(x**y) #Exponentiation
x = 9.191823
print(x//y) #Floor division -- floor rounds
#*down* to the nearest whole number
# Assignment Operators
x = 9 # set x = 9
x +=... |
def info():
return 'Modul menghitung rumus tentang persegi panjang'
def hitung_luas_persegi_panjang(panjang, lebar):
return panjang * lebar |
class LateralProfile(object):
def __init__(self):
self._superelevations = []
self._crossfalls = []
self._shapes = []
@property
def superelevations(self):
return self._superelevations
@superelevations.setter
def superelevations(self, value):
if not isinstan... |
# Using Dijkstra's algorithm for finding the shortest paths between nodes in a graph
# https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
def get_puzzle_input():
grid = []
with open("input.txt", mode="r", encoding="utf-8") as file:
for row in file:
numbers = [int(x) for x in row.strip()]
... |
def create_cast_list(filename):
"""
create a list of the actors who appeared in the television programme Monty Python's Flying Circus.
Write a function called create_cast_list that takes a filename as input and returns a list of actors' names. It will be run on the file flying_circus_cast.txt (this informa... |
# pedindo um frase
frase = str(input('Digite um frase: ')).strip().upper()
# analisando quantas letras tem A tem na frase
print(f'A letra A aparece {frase.count("A")} vezes na frase')
# analisando onde aparece a 1° letra A
print(f'A 1° letra A aparece na {frase.find("A")+1}° posiçao')
# analisando em qual posiçao a ult... |
class OptimisticDict(dict):
def __init__(self, factory_func):
self.factory_func = factory_func
super(OptimisticDict, self).__init__()
def __missing__(self, key):
self[key] = self.factory_func(key)
return self.factory_func(key)
|
# TRACK STATS
class Tracker:
def __init__(self):
self.att_count = 0
self.email_count = 0
self.regulars = 0
self.reappears = 0
self.unidentified = 0
def print(self):
print()
print(f'Downloaded {self.att_count} attachments from {self.email_count} emails')
print()
print(f'{self.regulars} Regulars')
... |
# Read pairs of numbers, and print the odd numbers between these numbers. Read the pairs until input == o, o
def check_odd_numbers(x, y):
odd_numbers = []
for i in range(x, y + 1):
if i % 2 != 0:
odd_numbers.append(i)
return odd_numbers
def main():
# Pairs separated by a comma
... |
def count_items(list):
if len(list) < 2:
return 1
else:
return 1 + count_items(list[1:])
print(count_items([2, 4, 6]))
|
def f():
return None, None
print(f())
if f():
print('aaa')
else:
print('bbb')
a = f()
print(*a)
|
class DockerContainerEntity:
def __init__(self):
self.image = None
self.environment = dict()
def set_environments(self, state: dict):
for k, v in state.items():
self.environment[k] = v
|
class Solution:
def isIsomorphic(self, s: str, t: str) -> bool:
def convert(ss):
d = {}
return [d.setdefault(c, len(d)) for c in ss]
return convert(s) == convert(t)
|
def comp_mass_magnet_id(self, index):
"""Compute the mass of the hole magnet of the corresponding index
Parameters
----------
self : HoleMag
A HoleMag object
index : int
Index of the magnet to compute the surface
Returns
-------
Mmag: float
Mass of the Magnet [m... |
# https://edabit.com/challenge/FQyaaJx7orS7tiwz8
# Write a function that takes an integer minutes and converts it to seconds.
def minute_to_seconds(minutes: float) -> int:
seconds = (minutes * 60)
return int(seconds)
print(minute_to_seconds(3.2))
|
#pvaluethon
f1=open("plot_t1.out","r")
f2=open("plot_t2.out","r")
f3=open("plot_t3.out","r")
f4=open("plot_t4.out","r")
f5=open("plot_t5.out","r")
f6=open("speedup.out","w")
f7=open("app.out","r")
l1=[]
l2=[]
l3=[]
l4=[]
l5=[]
li=[]
tmp1=[]
tmp2=[]
tmp3=[]
tmp4=[]
tmp5=[]
for line in f1.readlines():
for value in li... |
pares = input()
for i in range (0, pares):
a, b = input()
print("%d %d %d %d %d" % ((a+b), (a-b), (a*b), (a//b), (a%b)))
print("---")
|
def genreg_via_cycles(n, k, g, adjacency_lists=None, nj_stack=None, additional_edge_predicates=None):
"""
Generates and returns the first regular graph of n, k, g found via cycle generation
see http://www.mathe2.uni-bayreuth.de/markus/reggraphs.html
Implementation Notes:
could be modified to retur... |
EVENT_MEET_GUIDE = 64
EVENT_DESOLATED_CABIN = 65
EVENT_TRAINER_K1_PRE_1 = 66
EVENT_ITEMBALL_K1_PRE_1 = 67
EVENT_TRAINER_K1_PRE_2 = 68
EVENT_TRAINER_K1_PRE_3 = 69
EVENT_TRAINER_K1_PRE_4 = 70
EVENT_TUTORIAL_WILLOW = 71
EVENT_K1_PRE_COMPLETE = 72
EVENT_ITEMBALL_K1_POST_1 = 73
EVENT_SHOWED_METAPOD = 74
EVENT_TRAINER_K1_POS... |
class DropMessageSIPEntityException(Exception):
def __init__(self, description_string='SIP Entity Exception - dropping message'):
self.description = description_string
def __str__(self):
return self.description
class DropMessageAndDropConnectionSIPEntityException(Exception):
def __init__... |
class PathResolutionException(Exception):
"""
Raised when a path given to a template tag contained variables that could
not be resolved.
"""
|
def test_index_page(client):
result = client.get('/')
assert b'appengine_flask_security_auth' in result.data
|
class Solution:
def numberOfSubarrays(self, nums: List[int], k: int) -> int:
# subarray
seen = [0] * (len(nums) + 1)
seen[0] = 1
acc = 0
ans = 0
for num in nums:
acc += num % 2
ans += seen[acc - k]
seen[acc] += 1
return ans
|
# can_code = True
# if can_code == True:
# #Do a thing
# print("You can code!")
# else:
# #Do Something Else
# print("You don't know how to code yet!")
# teacher = "Kalob Taulien"
# if teacher == "Kalob Taulien":
# print("Show the teacher portal")
# else:
# print("You are a student. Welc... |
#N, M = [int(n) for n in input().split()]
#N = int(input())
S = input()
ans = 0
r = 0
for c in S:
if c == 'R':
r += 1
ans = r
else:
ans = max(ans, r)
r = 0
print(ans)
|
# Formatting configuration for locale is
languages={'is': u'\xedslenska'}
countries={'IS': u'\xcdsland'}
months=[u'jan\xfaar', u'febr\xfaar', 'mars', u'apr\xedl', u'ma\xed', u'j\xfan\xed', u'j\xfal\xed', u'\xe1g\xfast', 'september', u'okt\xf3ber', u'n\xf3vember', 'desember']
abbrMonths=['jan', 'feb', 'mar', 'apr', ... |
def radix_sort(inpt_list, base=10):
"""This sort takes in a list of positive numbers and returns the list sorted in place.
Arguments:
inpt_list {[list]} -- [Unsorted List]
Keyword Arguments:
base {int} -- [description] (default: {10})
Returns:
[list] -- [Sorted List]
"""... |
n = int(input())
mtx = [[0 for j in range(n)] for i in range(n)]
r, k = 0, 0
# 1 - Направление вправо
# 2 - Направление вниз
# 3 - Направление влево
# 4 - Направление вверх
dir = 1
row = n
col = n
for i in range(n**2):
if dir == 1 and k != col-1:
mtx[r][k] = i+1
k += 1
elif k == col-1 and r !=... |
## Generate Pascal's Triangle upto numRows rows
class Solution:
def generate(self, numRows: int) -> List[List[int]]:
if numRows==0:
return 0
pascal_tri = [[1]]
for i in range(2,numRows+1):
cur_level_nums = []
last_level_len = le... |
def solve(str1: str, str2: str) -> list[list[int]]:
dp = [[0 for _ in range(len(str2) + 1)] for _ in range(len(str1) + 1)]
for i in range(len(dp[0])):
dp[0][i] = i
for i, d in zip(range(len(dp)), dp):
d[0] = i
for i in range(1, len(str1) + 1):
for j in range(1, len(str2) + 1):... |
class Solution:
def __init__(self, radius: float, x_center: float, y_center: float):
self.radius = radius
self.x = x_center
self.y = y_center
def randPoint(self) -> List[float]:
# x = r * cos(theta) + x0
# y = r * sin(theta) + y0
# r: 0 ~ raduis
# th... |
"""
Author: CaptCorpMURICA
Project: 100DaysPython
File: module1_day12_augAssign.py
Creation Date: 6/2/2019, 8:55 AM
Description: Learn about augmented assignments in python.
"""
|
f = plt.figure(figsize=(10,4))
ax = plt.gca()
ax.set_aspect('equal')
is_weird = lmos.p_sim <= (.05/len(pres))
pres.plot(color='lightgrey', ax=ax)
pres.assign(quads=lmos.q)[is_weird].plot('quads',
legend=True,
k=4, categorical=True,
... |
class modulo_wifi(object):
def __init__(self):
pass
# Scan da rede wifi
def scan(self, ssid):
pass
def main():
# Chamando a classe wifi
mod_wifi = modulo_wifi()
def help_main():
print("""
Comandos principais
-------------------
Comando Descrição
--------- -----... |
year=int(input("Enter the year:\n"))
if(year%4==0 and year%100!=0 or year%400==0):
print("leap year")
else:
print("not a leap year")
|
#!/usr/bin/env python3
# inputs
num = int(input("Enter a number: "))
# processing
if num > 0:
result = "Positive"
elif num < 0:
result = "Negative"
else:
result = "Zero"
# outputs
print("You entered", result, "number")
|
class Component(object):
def operation(self):
print("Component instance has been created")
class ConcreteComponent(Component):
def operation(self):
print("ConcreteComponent instance has been created")
class Decorator(Component):
def __init__(self, component):
self._component = co... |
class IllegalCarError(Exception):
"""Raised when the attributes of Car class are wrong"""
pass
class Car:
def __init__(self, pax_count, car_mass, gear_count, ):
self.__pax_count = pax_count
self.pax_count_validation()
self.__car_mass = car_mass
self.car_mass_validation()... |
'''
This script gets the alias from README
and add them to bashrc to see if it throws an error or not.
'''
README = open("README.md")
ALIAS = ""
FOUND = False
for line in README:
if FOUND:
if line.strip() == "```":
print(ALIAS)
FOUND = False
else:
ALIAS += line
... |
class Rectangle:
def __init__(self, length, width):
self.length = length
self.width = width
def area(self):
return self.length * self.width
# An example for Super for parent construction.
class Square(Rectangle):
def __init__(self, length):
super(Square, self).__init__(len... |
#
## https://leetcode.com/problems/two-sum/
#
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for idx, val in enumerate(nums):
if target - val in nums[idx + 1 : len(nums)]:
return [idx, nums[idx + 1 : len(n... |
"""
Extend `django-admin startapp` to create testing structure for the new app
under the global `tests` directory.
"""
|
#
# PySNMP MIB module HP-ICF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF
# Produced by pysmi-0.3.4 at Wed May 1 13:33:17 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
... |
class ConfigKeys:
AGENT_SOCKET = "agent_socket"
LOGGING = "logging"
SAMPLER = "sampler"
PARAM = "param"
|
"""
Scope
"""
value = "Global Scope"
def write_v1():
value = "Inner Scope"
print(value)
def write_v2(value): # 1) by Value, 2) Overloading is not allowed
print("Param. Value: " + value)
Value = "Inner Scope"
print(Value)
def write_v3():
global value
print("Value: " + val... |
# -*- coding: utf-8 -*-
# tente algo como
#@cache.action(time_expire=300, cache_model=cache.ram, quick='P')
@auth.requires_login()
def show_contact():
a = auth.user
rows = db(db.contact.created_by == auth.user).select()
return locals()
def create_contact():
form = SQLFORM(db.contact).process()
if f... |
#
# Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# https://oss.oracle.com/licenses/upl/
#
# Parameters used by example code -- Cloud Simulator Configuration
#
# This file is configured for the examples to be run again... |
class Solution:
def findDiagonalOrder(self,mat):
m=len(mat)-1
n=len(mat[0])-1
direct=0 #1: up 0:down
isChanging=1 # if changing direction
res=[mat[0][0]]
i,j=0,0
while 1:
if i==m and j==n:
break
#current direction is U... |
# Configuration file for the Sphinx documentation builder.
#
# Full list of options can be found in the Sphinx documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# -- Project information -----------------------------------------------------
#
project = "sphinx-autobuild"
copyright = "201... |
# Exercise 06
def scalar_product(scalar,vector):
result = []
for v in vector:
result.append(v*scalar)
return result
def vector_addition(vector1, vector2):
result = []
if len(vector1)==len(vector2):
for index in range(len(vector1)):
result.append(vector1[index] + vector2[... |
###############################################################################
# Author: Sebastien Parent-Charette (support@robotshop.com)
# Version: 1.0.0
# Licence: LGPL-3.0 (GNU Lesser General Public License version 3)
#
# Desscription: A library that makes using the LSS simple.
# Offers support for most Py... |
''' Refaça o exercicio 51, lendo o primeiro termo e a razão de uma PA mostrando os 10 primeiros termos da progressão
usando a estrutura while '''
print('*'* 20 )
print(' GERADOR DE PA')
print('*'* 20 )
primeiro = int(input('Primeiro termo: '))
razao = int(input('Razão: '))
termo = primeiro
cont = 1
while cont <= 1... |
#dos formas
Numeros={5,6,2,4,7,3} #forma 1
print(Numeros)
S = set("Computadora y ratones") #forma 2
print(S)
t= len(S) #cuenta
print(t)
r = 6 in Numeros #para saber si un número pertenece al set
print(r)
p = 4 not in Numeros
print(p)
A = S.add("sw")
print(S)
Numeros.remove(4)
print(Numeros)
#Operadores de inters... |
def myPi(n):
denominator = 1
addto = 1
for i in range(n):
denominator = denominator + 2
addto = addto - (1/denominator)
denominator = denominator + 2
addto = addto + (1/denominator)
pi = addto * 4
return(pi)
print(myPi(1000000)) |
n = int(input())
s = str(input())
t = str(input())
cnt = 0
for i in range(n):
if s[i] != t[i]:
cnt += 1
print(cnt)
|
for number in range(1, 1001):
if number % 10 == 7:
print(number)
for i in range(7, 1000, 10):
print(i) |
nome = input('Digite nome do cliente: ')
vencimento = input('Digite o dia de vencimento: ')
mesDeVencimento = input('Digite o mês de vencimento: ')
valorFatura = input('Digite o valor da fatura: ')
print('Olá,', nome)
print('A sua fatura com vencimento em', vencimento, 'de',
mesDeVencimento, 'no valor de R$', va... |
def is_palindrome(word):
for left in range(len(word) // 2):
right = len(word) - left - 1
if word[left] != word[right]:
return False
return True
if __name__ == "__main__":
print(is_palindrome("racecar"))
|
"""
“私有变量”及“__all__列表”说明:
`from privateVariable_pkg import *` 语句将只能自动导入aaa和bbb
`__all__` 列表可以不论是否私有,都可自定义指定
"""
print('子模块中:', dir())
aaa = 1
_aaa = 1
__aaa = 1
__aaa__ = 1
bbb = 2
_bbb = 2
__bbb = 2
__bbb__ = 2
print('子模块中:', dir())
__all__ = ['__aaa', '__bbb'] # 手动指定要导入的模块
|
load(
"//:repositories.bzl",
"io_grpc_grpc_java",
"javax_annotation_javax_annotation_api",
"com_google_errorprone_error_prone_annotations",
"rules_proto_grpc_repos",
)
def java_repos(**kwargs):
rules_proto_grpc_repos(**kwargs)
io_grpc_grpc_java(**kwargs)
javax_annotation_javax_annotatio... |
def test_static_method():
class Base:
@staticmethod
def say() -> int:
return 1
class A(Base):
pass
class B(Base):
pass
a = A()
b = B()
assert a.say() == b.say()
def test_class_method():
class Base:
field = None
@classmethod
... |
'''
Description:
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).
Note:
s could be ... |
class AbstractTranslator:
def __init__(self, source_text, translate_from, translate_to, queue=None):
self.queue = queue
self.source_text = source_text
self.translate_from = translate_from
self.translate_to = translate_to
self.translation = ''
def _external_api_in... |
studenthall1Image_BASE_URL = "https://cnuis.cnu.ac.kr/jsp/etc/foodcourt1005.png"
variousCafeteria_BASE_URL = "https://cnuis.cnu.ac.kr/jsp/etc/toWeekMenu.jsp"
cafeteriaKoreans = ["학식", "🍽 학식"]
cafeteriaNormalReplies = [
["기숙사식당", "기숙사식당"],
["제1학생회관", "제1학생회관"],
["학생", "학생"],
["교직원", "교직원"]
# ["제2학생... |
with open('./data/AOC5.txt', 'r') as passport_file:
seats = [str(f) for f in passport_file.read().splitlines()]
def up_down(instruction: str, number_list):
lower, upper = split_list(number_list)
if instruction == 'F' or instruction == 'L':
return lower
elif instruction == 'B' or instruction ==... |
"""Some data and functions useful for converting to Lilypond"""
pitch_level = {"do": 0,
"di": 0,
"ra": 1,
"re": 1,
"ri": 1,
"me": 2,
"mi": 2,
"fa": 3,
"fi": 3,
"se": 4,
... |
def sums(n, k):
"""
Implement sums, which takes two positive integers n and k. It returns a list of lists containing all
the ways that a list of k positive integers can sum to n. Results can appear in any order.
Return the ways in which K positive integers can sum to N.
>>> sums(2, 2)
[[1, 1]]... |
lista_paises = [['Antigua y Barbuda', 'América', 103050],
['Argentina', 'América', 44688864],
['Bahamas', 'América', 399285],
['Barbados', 'América', 286388],
['Belice', 'América', 382444],
['Bolivia', 'América', 11215674],
['Brasil', 'América', 210867954],
['Canadá', 'América', 36953765],
['Chile', 'América', ... |
{
'targets': [
{
'target_name': 'tinyxml2',
'type': '<(library)',
'direct_dependent_settings': {
'include_dirs': [ '.', ],
},
'sources': [
'tinyxml2.h',
'tinyxml2.cpp'
]
},
],
} |
# Puzzle Input ----------
with open('Day02-Input.txt', 'r') as file:
puzzle = file.read().split('\n')
with open('Day02-Test01.txt', 'r') as file:
test01 = file.read().split('\n')
# Main Code ----------
# Split the command and number into a tuple and convert to the right data type
def split_and_convert(comma... |
class IDataConversionMonitor:
"""
A base class for an application-specific logger. It should be used to track errors during conversion and/or ,track conversion progress,cancel a conversion process if necessary.
Implementing a logger class is optional,but highly recommended for all but most basic data conv... |
number_of_people=int(input("how many people are there for this survey? "))
survey={}
geners={"Horror":0 , "Romance":0 , "Comedy":0 , "History":0 , "Adventure":0 , "Action":0 }
geners_list=[]
for i in range(number_of_people):
temp_name=input('\nplease enter your name: ')
for j in survey:
if j==temp_name:... |
# PythonJS binding for Ace Editor http://ace.c9.io/
# by Brett Hartshorn - copyright 2013
# License: "New BSD"
class AceEditor:
def __init__(self, div_id='editor', mode='python', theme=None):
with javascript: self[...] = ace.edit( div_id )
if mode: self.setMode( mode )
if theme: self.setTheme( theme )
def set... |
class AXI4Port(object):
__slots__ = ('__user_width','__data_width','__id_width','__user_width','__is_master')
def __init__(self):
self.__user_width = None
self.__data_width = None
self.__id_width = 9
self.__user_width = None
self.__is_master = None
@property
... |
class Enemy:
def __init__(self, name, desc, hp, strength, dexterity, defense, exp, coinL, coinH):
self.name = name
self.desc = desc
self.hp = hp
self.strength = strength
self.dexterity = dexterity
self.defense = defense
self.exp = exp
self.coinL = coin... |
# using a hashtable to count individual items
# define a set of items that we want to count
items = ["apple", "pear", "orange", "banana", "apple",
"orange", "apple", "pear", "banana", "orange",
"apple", "kiwi", "pear", "apple", "orange"]
# TODO: create a hashtable object to hold the items and count... |
#!/python3/bin/python3
5
x = 5
print("intial value of x \a")
print(x)
x=x + 1
print(x)
|
# SPDX-License-Identifier: MIT
# Copyright (c) 2020 The Pybricks Authors
"""
Hardware Module: Any hub.
Description: Prints Hello world!
"""
print("Hello world!")
|
RootWindow # unused class (libsyntyche/app.py:11)
StackedRootWindow # unused class (libsyntyche/app.py:22)
_.stack # unused attribute (libsyntyche/app.py:27)
run_app # unused function (libsyntyche/app.py:38)
_.eventFilter # unused method (libsyntyche/app.py:47)
obj # unused variable (libsyntyche/app.py:47)
autoco... |
# -*- coding: utf-8 -*-
if __name__ == '__main__':
cases = int(input())
for case in range(cases):
output = [float(num) for num in input().split()]
average = sum(output[1:]) / float(output[0])
count = sum(1 for num in output[1:] if float(num) > float(average))
percent = round(co... |
# adds in Platform column into datatable which represents on what platforms the show or movie is availble on
def plat(row):
string = ''
if row['Netflix'] == 1:
if string == '':
string+='Netflix'
else:
string+=',Netflix'
if row['Hulu'] == 1:
if string == '':
... |
"""
Последовательность состоит из натуральных чисел и завершается числом 0. Определите, сколько элементов этой
последовательности больше предыдущего элемента.
Формат ввода Вводится последовательность целых чисел, оканчивающаяся числом 0 (само число 0 в последовательность не
входит, а служит как признак ее окончания).
... |
{
"variables": {
'v8_enable_pointer_compression': 0,
'v8_enable_31bit_smis_on_64bit_arch': 0,
},
"targets": [
{
"target_name": "turbo-linecount",
"sources": ["addon.cpp", "turbo_linecount.cpp"],
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
'include_dirs': ["<!@(node -p \"requi... |
#In order to import and use these functions you will need the following lines of code:
#For a specific function:
# from math_functions import *function name*
#For all functions:
# import math_functions
#Note: in order to use the functions in this case you will need to write:
# math_functions.*... |
# -*- coding: utf-8 -*-
"""
Module docstring
TODO:
* Write module docstring
"""
class Hand:
"""Class to represent a hand of playing cards"""
def __init__(self):
self.cards = list()
self.value = 0
self.soft_value = 0
self.blackjack = False
self.bust = False
de... |
print("".strip())
print(" \t\n\r\v\f".strip())
print(" T E S T".strip())
print("abcabc".strip("ce"))
print("aaa".strip("b"))
print("abc efg ".strip("g a"))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.