content stringlengths 7 1.05M |
|---|
num = 1
for i in range(5):
for j in range(i+1):
print(num, end=" ")
num+=1
print() |
# coding=utf-8
""" python基础知识 """
"""
1,列表 = 数组
2,字典 = map
3,元祖 = 不可修改的数组 ,函数返回的结果集一般都是元祖。元组可以转列表
4,函数 def定义 ,可以传参和return
5,定义类 class ,有OOP的思想
"""
class MathUtils:
def __init__(self, a, b):
self.a = a
self.b = b
def compare(self):
if self.a > self.b:
... |
"""
Given an array of intervals where intervals[i] = [starti, endi],
merge all overlapping intervals, and return an array of the
non-overlapping intervals that cover all the intervals in the input.
Example 1:
Input: intervals = [[1,3],[2,6],[8,10],[15,18]]
Output: [[1,6],[8,10],[15,18]]
Explanation: Since interv... |
# -*- coding: utf-8 -*-
'''
File name: code\tidying_up\sol_253.py
Author: Vaidic Joshi
Date created: Oct 20, 2018
Python Version: 3.x
'''
# Solution to Project Euler Problem #253 :: Tidying up
#
# For more information see:
# https://projecteuler.net/problem=253
# Problem Statement
'''
A small child... |
class Quiz:
def __init__(self,question, alt, correct):
self.question = question
self.alt = alt
self.correct = correct
self.s =""
for a in range(len(self.alt)):
self.s =self.s+str(a+1)+". "+self.alt[a]+"\n"
def corect_ansrer_txt(self):
return "correct ... |
program_list = []
def execute_command_with_params(input):
command, params = input.split(sep=" ", maxsplit=1)
if command == "insert":
i, e = map(int, params.split(sep=" ", maxsplit=1))
program_list.insert(i, e)
if command == "remove":
e = int(params)
program_list.remove(e)... |
#
# @lc app=leetcode id=19 lang=python3
#
# [19] Remove Nth Node From End of List
#
# https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/
#
# algorithms
# Medium (35.65%)
# Likes: 5231
# Dislikes: 302
# Total Accepted: 852.5K
# Total Submissions: 2.4M
# Testcase Example: '[1,2,3,4,5]\n2'
... |
ano = int(input(("Saiba se o ano é bixexto: ")))
if ano % 4 == 0 and ano % 100 !=0 or ano % 400 == 0:
print("Esse ano é bisexto")
else:
print("Esse ano não é bisexto") |
def help():
help_file = "help.txt"
with open(help_file) as help:
content = help.read()
return(content)
|
"""params.py: default parameters for the neural style algorithm"""
#TODO: These should all be settable by command line flags to the actual script
content_path = "./images/mitart_lowres.jpg" # relative path of content input image
style_path = "./images/starrynight.jpg" # relative path of style input image
output_pa... |
def euclide_e(a, n):
u, v = 1, 0
u1, v1 = 0, 1
while n > 0:
u1_t = u - a // n * u1
v1_t = v - a // n * v1
u, v = u1, v1
u1, v1 = u1_t, v1_t
a, n = n, a - a // n * n;
return [u, v, a]
print(euclide_e(39, 5))
|
# Third-party dependencies fetched by Bazel
# Unlike WORKSPACE, the content of this file is unordered.
# We keep them separate to make the WORKSPACE file more maintainable.
# Install the nodejs "bootstrap" package
# This provides the basic tools for running and packaging nodejs programs in Bazel
load("@bazel_tools//to... |
"""
Copyright 2020 Daniel Cortez Stevenson
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
class Solution:
def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[int]]:
def dfs(cur, path):
if cur == len(graph) - 1:
res.append(path)
else:
for i in graph[cur]:
dfs(i, path + [i])
res = []
dfs(0, ... |
# model settings
# norm_cfg = dict(type='BN', requires_grad=False)
model = dict(
type='FasterRCNN',
pretrained='open-mmlab://resnext101_32x4d', #resnet50_caffe
backbone=dict(
type='ResNeXt',
depth=101, #50
groups=32,
num_stages=3,
strides=(1, 2, 2),
dilations=... |
def resolve():
'''
code here
'''
N, H = [int(item) for item in input().split()]
ab = [[int(item) for item in input().split()] for _ in range(N)]
a_max = max(ab, key=lambda x:x[0])
res = H // a_max
if H % a_max != 0:
res += 1
temp_attack = res * a_max
b_delta = [b - ... |
# -*- coding: utf-8 -*-
# source = https://de.wikipedia.org/wiki/Liste_der_Kfz-Nationalit%C3%A4tszeichen retrieved on 16.7.2015
car_signs = """
<table class="wikitable sortable zebra hintergrundfarbe1 jquery-tablesorter">
<thead><tr>
<th class="headerSort" tabindex="0" role="columnheader button" title="Aufsteigend sor... |
# Escreva um programa que leia a velocidade de um carro.
# Se ele ultrapassar 80km/h, mostre uma mensagem dizendo que ele foi multado.
# A multa vai custar R$7.00 por cada km acima do limite.
velocidade = float(input('Informe a velocidade do carro: '))
if velocidade > 80.00:
multa = 7.00 * (velocidade - 80)
pri... |
def parensvalid(stringInput):
opencount = 0
closedcount = 0
for i in range(0, len(stringInput), 1):
if stringInput[i] == "(":
opencount += 1
elif stringInput[i] == ")":
closedcount += 1
if closedcount > opencount:
return False
... |
## Verificar uma String
nome=str(input('Qual seu nome? '))
print('')
if nome == 'Wollacy':
print('Que nome bonito!')
elif nome == 'Pedro' or nome == 'Maria' or nome == 'João':
print('Nome popular no Brasil!')
else:
print('Nome comum!')
print('')
print('Olá {}!'.format(nome)) |
"""Chapter 1 Practice Projects.
Attributes:
VOWELS (tuple): Tuple containing characters of the English vowels
(except for 'y')
ENCODE_ERROR (str): String with :py:exc:`TypeError` for Pig Latin
:func:`~p1_pig_latin.encode`.
FREQ_ANALYSIS_ERROR (str): String with :py:exc:`TypeError` for Poo... |
expected_output = {
"operation_summary": {
1: {
"command": "rollback",
"duration": "00:00:04",
"end_date": "2021-11-02",
"end_time": "06:50:48",
"op_id": 1,
"start_date": "2021-11-02",
"start_time": "06:50:44",
"... |
#!/usr/bin/env python3
"""
created: 2022-03-14 20:58:57
@author: seraph★776
contact: seraph776@gmail.com
project: The Little Book of Programming Challenges
details: Challenge 3
"""
def get_length():
user_input = int(input('Enter length:\n> '))
return user_input
def get_width():
user_input = int(input('E... |
a = int(input("Input number a:\n"))
b = int(input("Input number b:\n"))
print(f"a + b = {a+b}")
print(f"a - b = {a-b}")
print(f"a * b = {a*b}")
print(f"a / b = {a/b}")
print(f"a ** b = {a**b}")
|
"""
This module includes information about Google search page specific HTML information to be used in parsing.
It includes class names such as the class assigned to search result DIV's etc.
"""
class GoogleDomInfoBase(object):
RESULT_TITLE_CLASS = 'r'
RESULT_URL_CLASS = '_Rm'
RESULT_DESCRIPTION_CLASS = '... |
# Our Input Array
arr = [3,2,4,1]
def Cyclic_sort(arr):
"""
This function will check if the element at i is at the correct index
or not. If it is not at the correct index then it will swap places and if
it is then we will increment the value of i by 1.
"""
i = 0
while i < len(arr):
... |
NAME = "vt2geojson"
DESCRIPTION = "Dump vector tiles to GeoJSON from remote URLs or local system files."
AUTHOR = "Theophile Dancoisne"
AUTHOR_EMAIL = "dancoisne.theophile@gmail.com"
URL = "https://github.com/Amyantis/python-vt2geojson"
__version__ = "0.2.1"
|
n= int(input())
my_dict = {}
for i in range((n*(n-1))//2):
mylist = []
x, y, z = input().split()
mylist.append(x)
mylist.append(y)
mylist.append(z)
first_t=mylist[0]
second_t = mylist[1]
first_t_score = mylist[2][0]
second_t_score = mylist[2][2]
if first_t_score<second_t_score:
... |
'''
Katie Naughton
Final Project
Intro to Programming
Sources:
'''
|
# NOTE: This address must be verified with Amazon SES.
SENDER = "Sender <no-reply@sender.com>"
# AWS Region you're using for Amazon SES.
AWS_REGION = "us-east-1"
# The character encoding for the email.
CHARSET = "UTF-8"
# This variable should be passed in from the invoker.
# NOTE: If your account is still in the sa... |
lista=[]
maior=0
menor=0
for k in range(5):
num=int(input(f'digite um número para a posição {k} :'))
lista.append(num)
if num>maior:
maior=num
if len(lista)==0:
menor=num
else:
if menor<=num:
menor=num
print('os números digitados foram',lista)
print(f'o... |
DEFAULT_CONFIG = {
# 是否开发模式
"dev": {
"dev_mode": False,
},
"commit_check": {
# 是否启动提交检查
"enabled": True,
# 提交标题行最大长度
"commit_summary_max_length": 50,
# 提交详细行最大行长度
"commit_line_max_length": 80,
# 二进制文件黑名单(逗号分隔的后缀名清单,无需带.,通过后缀名控制)
"b... |
class Canvas():
"""A Canvas."""
def __init__(self, height, width):
"""Initialize Canvas object"""
self.height = height
self.width = width
self.shapes = []
self.canvas_matrix = []
self.clear_shapes()
def print_canvas(self):
"""Print canvas drawing (wi... |
# https://leetcode.com/problems/remove-duplicate-letters/
# Given a string s, remove duplicate letters so that every letter appears once and
# only once. You must make sure your result is the smallest in lexicographical
# order among all possible results.
##############################################################... |
print('--------------------字典获取元素----------------------')
scores={'张三':12,'李四':22,'王五':44}
#使用[]
print(scores['张三'])
#使用get()
print(scores.get("张三"))
print(scores.get("里屋"))
print(scores.get('里屋',12)) #当查找的key不存在时,可以靠value来定位,但不能直接靠value定位
|
#%% Imports and function declaration
class Node:
def __init__(self, data):
self.data = data
self.next = None
# helper functions for testing purpose
def create_linked_list(arr):
if len(arr)==0:
return None
head = Node(arr[0])
tail = head
for data in arr[1:]:
tail.next... |
def random_gauss(mean, standard_deviation):
sum = 0
for _ in range(12):
sum = sum + random()
centered_around_zero = sum - 6
deviated = centered_around_zero * standard_deviation
gauss_value = deviated + mean
return gauss_value
# use the returned value as the next seed
# and use any numbe... |
class Point2D():
def __init__(self, x,y):
self.coord = [x,y]
def __str__(self):
return f'Point:({self.coord[0]},{self.coord[1]})'
def __eq__(self,other):
return (self.coord[0]==other.coord[0])&(self.coord[1]==other.coord[1])
def __ne__(self,other):
return (self.coord[0]... |
#Desenvolva um programa que simule a entrega de notas quando um cliente efetuar um saque em um caixa eletrônico. Os requisitos básicos são os seguintes:
#Entregar o menor número de notas;
#É possível sacar o valor solicitado com as notas disponíveis;
#Saldo do cliente infinito;
#Quantidade de notas infinito (pode-se co... |
# ex score
s = "2020020355 58 2020029225 45 2018044302 95 2020073145 50 2017011658 78 2020000373 66 2020071594 86 2020097210 81 2018044375 84 2018046671 48 2020046335 19 2020019270 78 2020088922 31 2013049852 31 2017011885 88 2020087010 61 2020097083 73 2020085232 83 2020044557 96 2020088568 96 2020021830 29 2020088813... |
def catch_exception(origin_func):
def wrapper(self, *args, **kwargs):
try:
# u = origin_func(self, *args, **kwargs)
u = origin_func(self,*args, **kwargs)
return u
except Exception:
self.revive() #不用顾虑,直接调用原来的类的方法
return 'an Exception raised... |
# Dictionary Carrent book with attributes
currentBook = {
"title": "Possibility of an Island",
"author": "Michel Houellebecq",
"price": 40
}
print(currentBook)
print(currentBook["author"])
currentBook["ISBN"] = "374795"
print("The Current book has these values:")
for value in currentBook.values():
p... |
# optimizes artifacts per roll, not exact values
# e.g. a +20 artifact has 5 rolls total
# rolls are averaged, with data from
# https://genshin-impact.fandom.com/wiki/Artifacts/Stats
# ===============================================
# how this works:
# ===============================================
# our damage equa... |
expr_dir = '/home/azhar/crnn-pytorch/output_run3/' # where to store samples and models
crnn_path='/home/azhar/crnn-pytorch/output_run1/netCRNNbest.pth'#path to trained recognition model
PSEnet_path='/home/azhar/summerResearch/MyPSEnet/0.234_epoch6_checkpoint.pth.tar.part'#path to trained detection model
expr_dir = './... |
def fo1():
print('1')
print('2')
print('3')
def main():
fo1()
print('a')
print('b')
print('c')
main() |
#!/usr/bin/python3
def solve(input_fname):
lines = []
pos = depth = aim = 0
with open(input_fname) as ifile:
for line in ifile:
lines.append(line.strip().split())
for cmd, unit in lines:
unit = int(unit)
if cmd == "forward":
pos += unit
depth ... |
{
"files.associations": {
"**/*.html": "html",
"**/templates/**/*.html": "django-html",
"**/templates/**/*": "django-txt",
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
},
"emmet.includeLanguages": {
"django-html": "html"
},
"python.pythonPath": "/usr/... |
class DevConfig(object):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/octocd'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = 'DEV_KEY'
|
#!/usr/bin/env python
""" Problem 61 daily-coding-problem.com """
def custom_pow(x: int, y: int) -> int:
if y == 0:
return 1
temp = custom_pow(x, int(y / 2))
if (y % 2 == 0):
return temp * temp
else:
if y > 0:
return x * temp * temp
else:
retur... |
def area(largura, cumprimento):
print(f'Sua área foi: {cumprimento * largura}')
largura = int(input('Digite sua largura: '))
cumprimento = int(input('Digite seu cumprimento: '))
area(largura, cumprimento)
|
class Education:
def __init__(self, school, time, title, desc):
self.school = school
self.time = time
self.title = title
self.desc = desc |
'''
## The PyLCONF
A LCONF parser and emitter for Python.
### Web Presence
* PyLCONF [web site](http://lconf-data-serialization-format.github.io/PyLCONF/)
* PyLCONF [github repository](https://github.com/LCONF-Data-Serialization-Format/PyLCONF/)
### Copyrights & Licenses
The *PyLCONF package* is licensed under ... |
#!/usr/bin/env python3
class FilterMiddleware(object):
def __init__(self, wsgi_app):
self.wsgi_app = wsgi_app
self.blacklist = ["sqlmap", "dirbuster"]
def __call__(self, environ, start_response):
try:
if any((x for x in self.blacklist if x in environ["HTTP_USER_AGENT"].low... |
w, b = input().split()
w = int(w)
b = float(b)
if (w % 5 == 0 and b>(w+.5)):
b = b - w - 0.5
print('%.2f' % b)
else:
print('%.2f' % b) |
# ======================================================================= #
# Copyright (C) 2020 Hoverset Group. #
# ======================================================================= #
"""
A store and manager for all application functions and routines
"""
class Routine:
... |
def valid_card(card):
return (
not sum(
[
d if i & 1 else d % 5 * 2 + d / 5
for i, d in enumerate(map(int, card.replace(" ", "")))
]
)
% 10
)
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# html_templates.py
"""
##############
HTML Templates
##############
*Created on Wed Jun 01 2015 by A. Pahl*
A simple and pythonic templating library where every HTML tag is a function.
"""
# import time
# import os.path as op
TABLE_OPTIONS = {"cellspacing": "1", "cell... |
def XPLMFindCommand(command):
return 1
def XPLMCommandOnce(commandID):
pass
|
# Copyright Least Authority Enterprises.
# See LICENSE for details.
"""
Tests for ``txkube.testing``.
"""
|
# -*- coding: utf-8 -*-
# © 2017 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
def dict_compare(d1, d2):
assert len(d1) == len(d2)
d1_keys = set(d1.keys())
d2_keys = set(d2.keys())
intersect_keys = d1_keys.intersection(d2_keys)
assert len(intersect_keys) == len(d... |
SERVICE_KPI_HOOK = (u"kpi_hook", u"KPI Hook POST")
SERVICE_CHOICES = (
SERVICE_KPI_HOOK,
)
default_app_config = "onadata.apps.restservice.app.RestServiceConfig"
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Advent of Code 2020
Day 22, Part 2
"""
def play_game(player1, player2):
seen = {1: [], 2: []}
while True:
if len(player1) == 0:
winner = 2
break
if len(player2) == 0:
winner = 1
break
if... |
# ---- ratings ----
urlpatterns += patterns('',
(r'^ratings/', include('ratings.urls')),
) |
# Total Purchase
# Simple Regsiter Program
print("In the fields below, enter the prices of five items")
totalAmount = float(input("What is the price of the first item? "))
totalAmount += float(input("What is the price of the second item? "))
totalAmount += float(input("What is the price of the third item? "))
totalAmo... |
n = int(input())
ans = n//4*"abcd"
if n%4==1:
ans += "a"
elif n%4==2:
ans += "ab"
elif n%4==3:
ans += "abc"
print(ans)
|
# Trigger: com.android.internal.telephony.gsm.GSMPhone.handleMessage(Landroid/os/Message;)V
# Callback: android.content.Context.sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;ILandroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V
IFAv0 = Int('IFAv0') # <Inpu... |
LOGFILE = '/tmp/robots.log'
def log(msg):
with open(LOGFILE, 'a') as f:
f.write(str(msg)+'\n')
|
# user defined-exceptions
# an exception class, that will serve as the base file for calculations
class CalculatorError(Exception):
""" Base class for my exception handlers for the calculator class\n
None value may be returned after a calculation, when an exception is
caught """
pass
|
## Beginner Series #2 Clock
## 8 kyu
## https://www.codewars.com/kata/55f9bca8ecaa9eac7100004a
def past(h, m, s):
hours = h * 60 * 60 * 1000
minutes = m * 60 * 1000
seconds = s * 1000
return hours + minutes + seconds
|
class HashTable:
def __init__(self, size: int):
if size < 1:
raise IndexError('Size of hashtable should be minimum 1')
self.size = size
self.data = [None] * size
def _hash(self, key):
hash_data = 0
for i in range(len(key)):
hash_data = (hash_data ... |
miles = 1000.0 # A floating point
name = "John" # A string
print(miles)
print(name)
|
class ScriptPlatformScriptGen:
def __init__(self):
pass
def GenerateScriptStart(self):
Script = "var layers = null;\r\n"
Script += "var filePath = activeDocument.fullName.path;\r\n"
Script += "var newDoc = app.activeDocument.duplicate();\r\n"
Script += "... |
class MyClass:
pass
var: [MyClass] = MyClass() |
"""Re-export of some bazel rules with repository-wide defaults."""
load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library")
load("//packages/bazel:index.bzl", _ng_module = "ng_module")
DEFAULT_TSCONFIG = "//packages:tsconfig-build.json"
def ts_library(tsconfig = None, **kwargs):
if not tsconfig:... |
## Get the mean of an array
## 8 kyu
## https://www.codewars.com/kata/563e320cee5dddcf77000158
def get_average(marks):
return sum(marks) // len(marks)
|
def main():
s=[]
minlen = 257
n=int(input())
for i in range(n):
s.append(list(input()))
s[i].reverse()
if len(s[i])<minlen: minlen = len(s[i])
kuchiguse = 0
nai = False
for i in range(minlen):
same = True
for j in range(1,n):
if s[j][i] !=... |
lorem_file = open("lorem.txt")
for line in lorem_file:
print(line.rstrip())
lorem_file.close()
|
class Articles:
'''
articles class to define article objects
'''
def __init__(self,id,author,description,url,urlToImage,publishedAt,content):
self.id = id
self.author = author
self.description = description
self.url = url
self.urlToImage = urlToImage
self.... |
#Activity 9
def factorial(n):
f = 1
for i in range (1, n + 1):
f = f * i
return f
def pascal(n):
for i in range (n):
for j in range (1, n - i):
print(" ", end = '')
for k in range (0, i + 1):
c = int(factorial(i) / (factorial(k) * factorial(i-k)))
... |
#!/usr/bin/env python
# coding: utf-8
# In[2]:
for i in range(0, 6):
if i == 3:
print("skip 3")
continue
print(i)
# In[3]:
for i in range(0, 6):
if i == 3:
print("skip 3")
break
print(i)
|
"""
Problem Description:
You are given with a String, you have to output count of vowels in the String.
Input:
Input contains a String.
Output:
Print vowel count in the String.
Constraints:
1≤String lenght≤1000
Sample Input:
Dcoder,A mobile coding platform
Sample Output:
10
"""
n = input()
c = 0
for i in n:
i... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'conditions': [
['OS=="android"', {
'targets': [
{
'target_name': 'native_test_apk',
'message': 'building nativ... |
def declarations(declaration):
if len(declaration[2][0]) > 1:
string = '%s _%s[%s];\n' %(
declaration[3][0],
declaration[0],
']['.join([
str(int(ranges[2]) - int(ranges[1]) + 1)
for ranges in declaration[2]
if len(ranges) > 1
])
)
string += '%s __%s(void) {\n' %(
declaration[3][0],
... |
class RainyRoad:
def isReachable(self, road):
for i, j in zip(*road):
if i == j == 'W':
return 'NO'
return 'YES'
|
data_path = '../data'
app_path = '../web-app'
naics_dict = {
'11': 'Agriculture, Forestry, Fishing, and Hunting',
'21': 'Mining, Quarrying, and Oil and Gas Extraction',
'22': 'Utilities',
'23': 'Construction',
'31': 'Manufacturing',
'32': 'Manufacturing',
'33': 'Manufacturing',
'42': '... |
sample_sizes = [100, 500, 1000, 5000, 10000, 15000, y.size]
scores_sample_sizes = {}
rng = np.random.RandomState(0)
for n_samples in sample_sizes:
sample_idx = rng.choice(
np.arange(y.size), size=n_samples, replace=False
)
X_sampled, y_sampled = X.iloc[sample_idx], y[sample_idx]
size, score = m... |
"""
백준 5893번 : 17배
"""
num = int(input(), 2) * 17
print(bin(num)[2:]) |
'''Given: A DNA string s
s
of length at most 1000 nt.
Return: Four integers (separated by spaces) counting the respective number of times that the symbols 'A', 'C', 'G', and 'T' occur in s
'''
s = 'AGACTCGCGCACTCACGATGAATCCCAAGACAGCCTGGCGGAGTATGGTACTACGGCCGTCCTCACCAAGGCATTTCGGTCCGAGTAGCGGATTGTGTGCCAGCCCTGAGGGCGAGTTA... |
# 200020001
if 2400 == chr.getJob():
sm.warp(915010000, 1)# should be instance ?
elif 2410 <= chr.getJob() <= 2411:
sm.warp(915020000, 2)
else:
sm.chat("Only Phantoms can enter.")
sm.dispose()
|
[
{'base_name': 'HEASARC_swiftmastr',
'service_type': 'tap',
'access_url': 'https://heasarc.gsfc.nasa.gov/xamin/vo/tap',
'adql':'''
SELECT
*
FROM swiftmastr
WHERE
1=CONTAINS(POINT('ICRS', ra, dec),
CIRCLE('ICRS', {}, {}, {}))
'''
}
]
|
#Los atributos describen las caracteristicas de los objetos, las clases es donde declaramos estos atributos,el atributo se utiliza segun las variables o tipos de datos que disponemos en python
# Metodos son acciones/funciones
# Constructor o inicializador para inicializar los objetos de una forma predeterminada que pod... |
BATCH_SIZE = 16
PROPOSAL_NUM = 6
CAT_NUM = 4
INPUT_SIZE = (448, 448) # (w, h)
LR = 0.0001
WD = 1e-4
SAVE_FREQ = 1
resume = ''
test_model = './checkpoints/model.ckpt'
save_dir = './trainlog/'
|
print('-' * 60)
print('{:^60s}'.format('LISTA DE PREÇOS'))
print('-' * 60)
tupla = (
('Lápis', '1.75'),
('Borracha', '2.00'),
('Caderno', '15.90'),
('Estojo', '25.00'),
('Transferidor', '4.20'),
('Compasso', '9.99'),
('Mochila', '120.32'),
('Canetas', '22.30'),
('Livro', '34.90')
)
... |
# Problem: Group Anagrams
# Difficulty: Medium
# Category: String
# Leetcode 49: https://leetcode.com/problems/group-anagrams/description/
# Description:
"""
Given an array of strings, group anagrams together.
For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],
Return:
[
["ate", "eat","tea"],
["nat","ta... |
def _chomp_element(base, index, value):
"""Implementation of perl = and chomp on an array element"""
if value is None:
value = ''
base[index] = value.rstrip("\n")
return len(value) - len(base[index])
|
class Credentials:
BASE_URL = "http://localhost:8080"
# Login Page
LOGIN_PAGE_TITLE = "OpenProject"
USERNAME = "admin"
PASSWORD = "qazwsxedcr"
# Home Page
HOME_PAGE_TITLE = "OpenProject"
HOME_PAGE_SELECTED_PROJECT = "TestProject1"
# New Project page
NEW_PROJECT_PAGE_TITLE = "N... |
# 数据库类别
# 付费的商用数据库
'''
Oracle
SQL Server 微软自家产品,windows定制专款
DB2 IBM产品
Sybase
'''
# 开源数据库
'''
MySQL
PostgreSQL
sqlite 嵌入式数据库,适合桌面和移动应用
''' |
'''
THE PROBLEM
A prime number (or a prime) is a natural number greater than 1 that has
no positive divisors other than 1 and itself.
The property of being prime is called primality. A simple but slow method of
verifying the primality of a given number is known as trial division. It
consists of testing whether is a mul... |
x1 = float(input("Enter x1: "))
y1 = float(input("Enter y1: "))
x2 = float(input("Enter x2: "))
y2 = float(input("Enter y2: "))
m = (y2 - y1) / (x2 - x1)
print("Gradient is {:g}".format(m))
c = y1 - (m * x1)
print("y-int is {:g}".format(c))
print("Equation: y = {:g}x + {:g}".format(m,c)) |
# See https://developers.notion.com/reference/request-limits
RICH_TEXT_CONTENT_MAX_LENGTH = 2000
RICH_TEXT_LINK_MAX_LENGTH = 1000
EQUATION_EXPRESSION_MAX_LENGTH = 1000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.