content stringlengths 7 1.05M |
|---|
maxPal=0
for i in range(999,900,-1):
for j in range(999,99,-1):
num=str(i*j)
if(num == num[::-1]):
if(i*j > maxPal):maxPal=i*j
break
print(maxPal)
|
# this is from https://github.com/mledoze/countries
countries_info = [
{
"name": {
"common": "Afghanistan",
"official": "Islamic Republic of Afghanistan",
"native": {
"common": "\u0627\u0641\u063a\u0627\u0646\u0633\u062a\u0627\u0646",
"offi... |
def findFriendByName(name):
friends = hero.findFriends()
for friend in friends:
if friend.id == name:
return friend
return None
sergeant = hero.findNearest(hero.findFriends())
wereList = sergeant.wereList
wereNames = wereList.split(",")
for name in wereNames:
trimmedName = name.st... |
class Dictish:
def __init__(self, *args):
"""
Example: Dictish([("first", 1), ("second", 2)])
"""
self.keys_and_values = []
if args:
for key_and_value in args[0]:
if key_and_value not in self.keys_and_values:
self.keys_and_value... |
# String Compression: compress string by repeat characters; if compression doesn't reduce length, return original
def number_compression(s: str) -> str:
result = ""
i = 0
while i < len(s) - 1:
char = s[i]
count = 1
while i + 1 < len(s) and char == s[i + 1]:
count += 1
... |
#
# PySNMP MIB module WATCHGUARD-PRODUCTS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/WATCHGUARD-PRODUCTS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:36:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... |
name = "test_variant_split_mid2"
version = "2.0"
variants = [["test_variant_split_end-1"], ["test_variant_split_end-3"]]
|
print('Analisando cidade')
cid = str(input('Digite o nome da cidade que você mora:')).strip()
cid = cid.lower()
print('Ela começa com a palavra Santo? {}'.format('santo' in cid))
print(cid[:5].lower() == 'santo')
|
"""
_
"""
for _ in range(0, 50):
print("Hello")
|
products = [
{'name': 'laptop', 'price': 800, 'quantity': 4},
{'name': 'mouse', 'price': 40, 'quantity': 10},
{'name': 'monitor', 'price': 400, 'quantity': 3}
] |
expected_output = {
"my_state": "13 -ACTIVE",
"peer_state": "8 -STANDBY HOT",
"mode": "Duplex",
"unit": "Primary",
"unit_id": 48,
"redundancy_mode_operational": "sso",
"redundancy_mode_configured": "sso",
"redundancy_state": "sso",
"maintenance_mode": "Disabled",
"manual_swact":... |
class Checkout:
class Discount:
def __init__(self, nItems, price):
self.nItems = nItems
self.price = price
def __init__(self):
self.prices = {}
self.discounts = {}
self.items = {}
def addItemPrice(self, item, price):
self.prices[item] = price... |
patches = [
{
"op": "move",
"from": "/PropertyTypes/AWS::IoTWireless::FuotaTask.LoRaWAN",
"path": "/PropertyTypes/AWS::IoTWireless::FuotaTask.FuotaTaskLoRaWAN",
},
{
"op": "replace",
"path": "/ResourceTypes/AWS::IoTWireless::FuotaTask/Properties/LoRaWAN/Type",
... |
class Page():
def __init__(self):
self.url = ''
self.title = ''
self.message = ''
|
# from django.conf import settings
# from django.db import models
# from django.utils import timezone
class User(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=100)
firstName = models.TextField()
lastName = models.TextFi... |
# This is a copy of IANA DNS SRV registry at:
# http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml
# source xml file updated on 2012-09-11
UDP_SERVICES = {
"tcpmux":'''TCP Port Service Multiplexer''',
"compressnet":'''Management Utility''',
"compressnet":'''Compression ... |
default_config = {
'relay_fee_per_kb': 3000
}
class FeePolicyChecker:
def __init__(self, config = default_config):
self.relay_fee_per_kb = int(config['relay_fee_per_kb'])
def check_tx(self,tx):
size = len(tx.serialize())
if tx.coinbase:
size -= 2 #le... |
'''Program to check whether the given number is paliandrome or not
Input Format
a number from the user
Constraints
n>0
Output Format
Yes or No
Sample Input 0
123
Sample Output 0
No
Sample Input 1
121
Sample Output 1
Yes'''
#solution
def pall(num):
if num == num[::-1]:
return "Yes"
return "N... |
class opt(object):
def __init__(self, data_dir, save_dir, gen_dir,
ratio, num_layers, hidden_size, embedding_size,
cuda, batch_size, seq_len, num_epochs,
save_every, print_every, valid_every,
grad_clip, learning_rate):
# The Param... |
# -*- coding: utf-8 -*-
# Define self package variable
__version__ = "0.2.1"
description = 'Python package for upstream preprocessing and downstream analysis of nanopolish'
long_description = """"""
# Collect info in a dictionary for setup.py
setup_dict = {
"name": __name__,
"version": __version__,
"desc... |
init_4_nginx = """
#!/bin/bash
apt -y update
apt -y install nginx
#put a default welcome page
mkdir /var/www/ksws_html
echo "<html>
<body>
<h1>Welcome to KSWS today!<h1>
</body>
</html>" > /var/www/ksws_html/index.html
#setup our demo site
echo "
server {
listen 80 default_server;
listen [::]:80 default_... |
"""
LeetCode Problem: 398. Random Pick Index
Link: https://leetcode.com/problems/random-pick-index/
Language: Python
Written by: Mostofa Adib Shakib
Time Complexity: O(N)
Space Complexity: O(1)
Explanation:
Draw the 1st number. If there is a second number, then we will hold 1st number by probability = 1/2, and
repla... |
def tribonacci(signature, n):
newl = []
h1 = signature[0]
h2 = signature[1]
h3 = signature[2]
for i in range(n):
h1 = signature[i]
h2 = signature[i + 1]
h3 = signature[i + 2]
h4 = h1 + h2 + h3
newl.append(h4)
return newl
l = {1,0,0}
print(tribonacci(... |
# https://www.globaletraining.com/
# Accessing Class and Object Variables/Attributes
class Car:
# Class Attributes/Variables
no_of_tires = 4
# Class Constructor/Initializer (Method with a special name)
def __init__(self, make, model, year, color, moon_roof=False):
# Object Attributes/Variable... |
# Zapytaj użytkownika o numer telefonu i wypisz go w postaci zanonimizowanej:
# wypisz pierwsze 6 cyfr, pozostałe zastąp myślnikiem
phone_number = input("Jaki jest Twój numer telefonu? ")
phone_number = phone_number.replace("-", "")
public_digits = phone_number[:6]
number_of_private_digits = len(phone_number) - 6
priv... |
""" Preprocessor macros.
"""
class BaseMacro:
""" Base macro """
def __init__(self, name, protected=False):
self.name = name
self.protected = protected
class Macro(BaseMacro):
""" Macro define """
def __init__(
self, name, value, args=None, protected=False, variadic=False
... |
def conv_module_cifar(nnet, nfilters):
filter_size = (3, 3)
pad = 'same'
use_batch_norm = True
nnet.addConvLayer(num_filters=nfilters,
filter_size=filter_size,
pad=pad,
use_batch_norm=use_batch_norm)
nnet.addReLU()
nnet.addConv... |
def config(app):
app.config.update(
authenticate=False
)
|
with open(FILE, mode='w') as file:
writer = csv.writer(file, lineterminator='\n')
writer.writerows(DATA)
|
print('user1')
print('user 3')
print('user 2')
|
class Node:
def __init__(self, char, weight):
self.char = char
self.weight = weight
self.children = dict()
self.count = 0
def add_child (self, child):
self.children[child.char] = child
def reinforce(self, reinforcement_rate):
self.count += 1
self... |
class Myclass:
var="test"
def funcao (self):
print("This is the message inside my class")
myobject=Myclass()
print(myobject.var)
myobject.funcao()
myobject2=Myclass()
myobject2.var="Hello World"
print(myobject.var)
print (myobject2.var) |
#Exercício Python 008: Escreva um programa que leia um valor em metros
# e o exiba convertido em centímetros e milímetros.
print(5*'=','VAMOS CONVERTER AS UNIDADES MÉTRICAS',5*'=')
metro = float(input('Qual valor em metros? '))
dc = metro * 10
cm = metro * 100
mm = metro * 1000
print(f'{metro:.2f} metros representa... |
#!/usr/bin/env python3
# Copyright 2022 The Pigweed Authors
#
# 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 applicab... |
class Solution:
def findClosestElements(self, arr: List[int], k: int, x: int) -> List[int]:
if x<=arr[0]:
return arr[:k]
if x>=arr[-1]:
return arr[-k:]
l=0
r=len(arr)-k
while l<r:
mid = l+(r-l)//2
... |
def distance(s1, s2):
if len(s1) != len(s2):
raise ValueError("Sequences not of equal length.")
return sum(a != b for a, b in zip(s1, s2))
|
# @ Fábio C Nunes 08/05/2020
# Faça um programa que leia o nome completo de uma pessoa, mostrando em seguida o primeiro e o ultimo nome.
n_completo = str(input('Digite seu nome completo: ')).strip()
lista = (n_completo).split()
print('Seu primeiro Nome é: ', lista[0])
i = len(lista)-1
print('Seu último nome é: ',lista[... |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# 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... |
class Device(object):
def __init__(self):
self.name = 'Unknown Device'
self.ip = None
self.identifier = None
self.app_installed = False
def is_remote(self):
return self.ip is not None
def is_usb(self):
return self.ip is None and self.identifier is not None... |
#!/usr/bin/env python
class OPT:
"A python container for operator types enumerator"
EQ = 1
NE = 2
GT = 3
GE = 4
LT = 5
LE = 6
|
cows_num = int(input())
cows_list = []
for cow_num in range(cows_num):
postion, infected = map(int, input().split())
cows_list.append([postion, infected])
cows_list.sort()
min_offset = None
for cow_num, cow in enumerate(cows_list):
if cow_num + 1 == len(cows_list):
break
if cows_... |
__author__ = 'yinjun'
# Definition for singly-linked list with a random pointer.
# class RandomListNode:
# def __init__(self, x):
# self.label = x
# self.next = None
# self.random = None
class Solution:
# @param head: A RandomListNode
# @return: A RandomListNode
def copyRandomLi... |
"""#############################################################################
## PROGRAM: Nice Netcat...
## FILENAME: picoCTF_GC_NiceNetcat.py
## AUTHOR: Om3g4b1u3
#############################################################################"""
## VARIABLE(S) ##
file_path = "flag_NiceNetcat.text"... |
class Handling:
"""
An object representing a request received by an endpoint and the
response it returns.
"""
def __init__(self, endpoint, request, response):
self.endpoint = endpoint
self.request = request
self.response = response
def __repr__(self):
return ('... |
"""P6E13 VICTORIA PEÑAS
Desarrolla de nuevo el ejercicio de la práctica anterior de los números
primos, con while. Reflexiona y escribe en el propio programa en forma
de comentario, qué opción es mejor y por qué."""
j=2
while num%j!=0:
primo=" es primo."
j+=1
if num%j==0 and j!=num:
primo=" no es pr... |
# Space: O(n)
# Time: O(n)
# Explanation:
# Monotonic stack approach
# Using stack to save INDEX of temperatures, the stack is in "ascending" order. (lowest temperature in the bottom).
# Loop through each item, when the current temperature is greater than stack top temperature, then start to pop item out
# of stack, ... |
"""
Write a function rotate(ar[], d, n) that rotates arr[] of size n by d elements.
"""
def rotate(nums, k):
n = nums[:]
for j in range(k):
n.append(n.pop(0))
return n
def rotate_using_temp(nums, k):
temp = []
for j in range(k, len(nums)):
temp.append(nums[j])
for i in rang... |
class noise:
def __init__(self, mean=0., std = 1., mag = 0.1):
self.mean = mean
self.std = std
self.mag = mag
self.rg = Generator(PCG64())
def draw(self):
return self.mag * self.rg.normal(self.mean, self.std) |
# _*_coding:utf-8_*_
class Solution:
def ReverseSentence(self, s):
if None is s or len(s) <= 0:
return ""
word = ""
result = ""
for item in s:
if ' ' == item:
result = word + result
result = item + result
word... |
"""
Given an array of integers A and let n to be its length.
Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a "rotation function" F on A as follow:
F(k) = 0 * Bk[0] + 1 * Bk[1] + ... + (n-1) * Bk[n-1].
Calculate the maximum value of F(0), F(1), ..., F(n-1).
Note:
n is gu... |
old_ops = parent().findChildren( type = containerCOMP, depth = 1 )
config_DAT = op( 'select_config' )
def delete_old_ops():
for each_op in old_ops:
each_op.destroy()
return
def create_new_ops():
new_op = parent().create( containerCOMP, 'container_' + config_DAT[ 0, 0 ] )
new_op.par.externaltox = con... |
def get_digits(n):
while str(n):
yield n % 10
n = n // 10
if not n:
break
digit = get_digits(1729)
print(next(digit)) # 9
print(next(digit)) # 2
print(next(digit)) # 7
print(next(digit)) # 1
for digit in get_digits(74831965):
print(digit)
# 5
# 6
# 9
# 1
# 3
# 8
# 4
# 7
... |
# Project Euler
# Problem 18 - Maximum path sum I
# (c) 2020-2022 Jordan Sola. All rights reserved. (MIT License)
# Written by Jordan Sola 2021
def compute():
set = [ [75],
[95,64],
[17,47,82],
[18,35,87,10],
[20, 4,82,47,65],
[19, 1,23,75, 3,34],
[88, 2,77,73, 7,63,67],
[99,65, 4,28,6,16,70,92... |
class Solution:
def getPermutation(self, n, k):
"""
:type n: int
:type k: int
:rtype: str
"""
nums = list(range(1, n+1))
factorials = [1]
for i in range(1, n):
factorials.append(i*factorials[-1])
cnt = n
k -= 1
resul... |
class ResourceMetamodel(object):
def __init__(self, resource):
self.resource = resource
def _request(self, obj):
form = self.resource._get_form(inst=obj, initial=self.resource._get_form_initial(obj))
result = {}
for key, field in form.fields.items():
choices = geta... |
ged_data = []
def initialize_file():
global ged_data
ged_data = []
def add_line(hierarchy,type,value=None):
global ged_data
if value:
ged_data.append(str(hierarchy) + ' ' + str(type) + ' ' + str(value))
else:
ged_data.append(str(hierarchy) + ' ' + str(type))
def append_record(pare... |
#List 1
a = ['physics','chemistry',2003,2009]
#List 2
b = [1,2,3,4,5]
#List 3
c = ["p","r","s"]
a.insert(0,'Biology')
b.insert(5,6)
c.insert(1,"q")
print(a,b,c)
#Result
#['Biology', 'physics', 'chemistry', 2003, 2009] [1, 2, 3, 4, 5, 6] ['p', 'q', 'r', 's']
|
#
# PySNMP MIB module SUN-ILOM-CONTROL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SUN-ILOM-CONTROL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:12:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... |
#
# @lc app=leetcode id=162 lang=python3
#
# [162] Find Peak Element
#
# https://leetcode.com/problems/find-peak-element/description/
#
# algorithms
# Medium (42.90%)
# Likes: 1518
# Dislikes: 1915
# Total Accepted: 338.7K
# Total Submissions: 789.3K
# Testcase Example: '[1,2,3,1]'
#
# A peak element is an eleme... |
def sum_squares(x, y):
return add(square(x), square(y))
def print_square(x):
print(square(x))
def percent_difference(x, y):
difference = abs(x-y)
return 100 * difference / x
|
class Subject:
def register_observer(self, observer):
raise NotImplementedError
def remove_observer(self, observer):
raise NotImplementedError
def notify_observers(self):
raise NotImplementedError
class WeatherData(Subject):
def __init__(self):
self.humidity = None
... |
# ----------
# Feature extraction
# ----------
class ExtendedFeatures:
def __init__(self, dataset):
self.feature_dic = {}
self.feature_names = []
self.nr_feats = 0
self.feature_list = []
self.add_features = False
self.dataset = dataset
# Speed up
se... |
__all__ = ['search_and_vet_one']
def search_and_vet_one(ticid, sector, config, vetter_list, plot=True):
"""
Search and vet one TIC ID using your config and vetter list.
"""
# TODO: Implement me
|
#!/usr/bin/env python3
VELOCITY_RANGE = range(1,127)
VELOCITY_PPP = 16
VELOCITY_PP = 32
VELOCITY_P = 48
VELOCITY_MP = 64
VELOCITY_MF = 80
VELOCITY_F = 96
VELOCITY_FF = 112
VELOCITY_FFF = 127
|
def test():
assert (
"from spacy.tokens import Doc" in __solution__
), "Are you importing the Doc class correctly?"
assert doc.text == "spaCy is cool!", "Are you sure you created the Doc correctly?"
assert "print(doc.text)" in __solution__, "Are you printing the Doc's text?"
__msg__.good("We... |
PORT = 8443
# name -> secret (32 hex chars)
USERS = {
"tg": "0123456789abcdef0123456789abcdef",
"tg2": "ad36e2fa0de7aca0d81c7c152fb06c80",
"tg3": "29075bb048ce065adf59cd67afa496e6",
"tg4": "0d7eac72cac961d9645f6515cd8c1afd",
"tg5": "8afbf4a2b7260e6b4ee8ee9b4c09c732",
}
MODES = {
# Cl... |
"""Loads the ipcamera library"""
# Sanitize a dependency so that it works correctly from code that includes
# Apollo as a submodule.
def clean_dep(dep):
return str(Label(dep))
def repo():
native.new_local_repository(
name = "ipcamera",
build_file = clean_dep("//third_party/ipcamera:ipcamera.BU... |
class vehicle:
def general_usage(self):
print('general use: transportation')
class Car(vehicle):
def __init__(self):
print("I am car")
self.wheels = 4
self.has_roof = True
def specific_usage(self):
self.general_usage()
print("Specific use: commute to... |
LEGACY_TYPICAL_INPUT = {
"hrDates": [
"2019-12-16 08:24:36",
"2019-12-16 09:32:17",
"2019-12-16 14:53:35",
"2019-12-16 16:13:35",
"2019-12-16 19:23:28",
"2019-12-16 23:56:25",
],
"hrValues": ["74", "83", "89", "157", "95", "80"],
}
LEGACY_INCOMPLETE_INPUT = {... |
""" Exception for the admin-commands-app """
class CommandError(Exception):
pass
|
num1 = 10
num2 = 20
string = "Hello World"
isTrue = True
print(num1 + num2)
print(isTrue)
print(string)
|
"""
"""
def construct_address(host, port, route, args):
"""
{host}:{port}{route}?{'&'.join(args)}
:param str host: '172.0.0.1'
:param str port: '5000'
:param str route: '/store/file/here'
:param list[str] args: ['a=b', 'c=d']
"""
return f"http://{host}:{port}{rout... |
def find_min_max(nums):
mini = maxi = nums[0]
for num in nums[1:]:
if num < mini:
mini = num
continue
elif num > maxi:
maxi = num
return mini, maxi
# Tests
assert find_min_max([4, 3, 1, 2, 5]) == (1, 5)
|
def blocks(fobj):
block = []
counter = 0
for line in fobj:
block.append(line)
counter += 1
if counter == 10:
yield block # 返回中间结果,下次取值,从这里继续向下执行
block = []
counter = 0
if block:
yield block
if __name__ == '__main__':
fobj = open('... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
class ClassSink:
async def sink(self, argument):
pass
class ClassSource:
async def source(self):
pass
def test(cl... |
'''
Variavel com break
variavel = ['Luiz Otavio', 'Joãozinho', 'Maria']
for valor in variavel:
print(valor)
break
print(valor)
# checa se a string começa com tal letra.
variavel = ['Luiz Otavio', 'Joãozinho', 'Maria']
for valor in variavel:
if valor.startswith('J'):
print('Começa com J', va... |
class Solution:
def getRange(self, arr, target):
left = self.bin_search(arr, 0, len(arr)-1, target, find_min=True)
right = self.bin_search(arr, 0, len(arr)-1, target, find_min=False)
return [left, right]
def bin_search(self, arr, low, high, target, find_min):
while low <= high... |
class A:
def __init__(self):
print('A class call ')
class B(A):
def __init__(self):
print('B class call')
A.__init__(self)
class C(A):
def __init__(self):
print('C class call')
A.__init__(self)
class D(B,C):
def __init__(self):
print('D class call')
... |
def functionA():
print("This is a testing script")
if __name__ == '__main__':
functionA()
#functionB() |
#Faça um programa que leia a largura e a altura de uma parede em metros , calcule a sua área e a
# quantidade de tinta necessária para pinta-la, sabendo que cada litro de tinta pinta uma area de 2m²
larg = float(input('Largura da parede : '))
alt = float(input( 'Altura da parede : '))
area = larg * alt
print('Sua pa... |
""" The Module containing the Knuth-Morris-Pratt (KMP) algorithm
used to find occurrences of matching substrings
"""
# There are two parts of this algorithm:
# 1.) A function for generating the prefix tables for the given pattern to match
# 2.) The function performing the main matching
def get_prefix_suffix(patt... |
#Faça um programa que receba a temperatura média de cada
#mês do ano e armazene-as em uma lista. Após isto,
#calcule a média anual das temperaturas e mostre todas
#as temperaturas acima da média anual, e em que mês
#elas ocorreram (mostrar o mês por extenso:
#1 – Janeiro, 2– Fevereiro, . . . ).
vetor=[]
for c in ran... |
'''
02 - Stacked bar chart
A stacked bar chart contains bars, where the height of each bar represents values.
In addition, stacked on top of the first variable may be another variable.
The additional height of this bar represents the value of this variable. And you can
add more bars on top of that.
In this exerci... |
# This program also demonstrates a simple for
# loop that uses a list of numbers.
print('I will display the odd numbers 1 through 9.')
for num in [1, 3, 5, 7, 9]:
print(num)
|
# Q S M L
# Error Class
# michaelpeterswa 2020
class QSMLError(Exception):
def __init__(self, message, line):
self.message = message
self.line = line
def __str__(self):
msg = self.message
line = self.line
return "%s at line %i" % (msg, line)
|
class Solution:
def search(self, nums: list[int], target: int) -> int:
L, H = 0, len(nums)
while L < H:
M = (L+H) // 2
if (target < nums[0]) and (nums[0] < nums[M]): # -inf
L = M+1
elif (target >= nums[0]) and (nums[0] > nums[M]): # +inf
... |
class OperationNotSupported(Exception):
def __init__(self, msg):
super().__init__(msg)
class CompilationError(Exception):
def __init__(self, msg):
super().__init__(msg)
|
valor = int(input())
impar = 0
for c in range(0, valor+1):
if c % 2 != 0:
print(c)
|
"""
A simple WSGI application for testing.
"""
_app_was_hit = False
def success():
return _app_was_hit
def simple_app(environ, start_response):
"""Simplest possible application object"""
status = '200 OK'
response_headers = [('Content-type','text/plain')]
start_response(status, response_headers)
... |
D = { 'UUU' : 'F', 'CUU' : 'L', 'AUU' : 'I', 'GUU' : 'V',
'UUC' : 'F', 'CUC' : 'L', 'AUC' : 'I', 'GUC' : 'V',
'UUA' : 'L', 'CUA' : 'L', 'AUA' : 'I', 'GUA' : 'V',
'UUG' : 'L', 'CUG' : 'L', 'AUG' : 'M', 'GUG' : 'V',
'UCU' : 'S', 'CCU' : 'P', 'ACU' : 'T', 'GCU' : 'A',
'UCC' : 'S', 'CCC' : 'P'... |
# See also examples/example_track/track_meta.py for a longer, commented example
track = dict(
author_username='alexisbcook',
course_name='Data Visualization',
course_url='https://www.kaggle.com/learn/data-visualization',
course_forum_url='https://www.kaggle.com/learn-forum/161291'
)
lessons = [{'topic'... |
m50 = maior = m = 0
qtd = int(input('Quantas pessoas deseja cadastrar? '))
for c in range(0, qtd):
x = int(input(f'Idade {c+1}: '))
if x >= 50:
m50 += 1
m = m + x
if x >= maior:
maior = x
print(f'Qtd de pessoas +50: {m50}')
print(f'Media de idades: {m/qtd:.2f}')
print(f'Mais velha: {m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""app.py: challenge #4"""
__author__ = "Carlan Calazans"
__copyright__ = "Copyright 2016, Carlan Calazans"
__credits__ = ["Carlan Calazans"]
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Carlan Calazans"
__email__ = "carlancalazans at gmail dot com"
__status... |
"""import math
n = float(input('Digite um número real qualquer: '))
print ('O número {} tem a parte inteira {}.'.format(n,math.trunc(n)))"""
n = float(input('Digite um número real qualquer: '))
print(
f'O número {n} tem a parte inteira {int(n)}.')
|
#
# PySNMP MIB module APPACCELERATION-SMI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APPACCELERATION-SMI
# Produced by pysmi-0.3.4 at Wed May 1 11:23:30 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... |
"""
=============================
Standard Output (second time)
=============================
This example captures the stdout and includes it in the
example. If output is too long it becomes automatically
framed into a text area.
"""
print('We print something on the standard output.')
print("A couple of lines.")
##... |
# https://atcoder.jp/contests/arc016/tasks/arc016_2
N = int(input())
count = 0
fumen = []
for _ in range(N):
fumen.append([s for s in input()])
for c in range(9):
uncount_flag = False
for r in range(N):
if fumen[r][c] == 'x':
count += 1
uncount_flag = False
conti... |
def print_matrix(m):
for i in range(len(m)):
print(m[i])
def m():
matrix = list()
n = int(input())
for i in range(n):
row = input().split()
row = list(map(int, row))
matrix.append(row)
get_diagonal(matrix)
def get_diagonal(m):
result = lis... |
pronouns = [
"Senpai",
"Onii-chan",
"Nii-san",
"Baka",
"Goshujinsama"
]
reactions = [
">~<",
">-<",
">w<",
"^w^",
"owo",
"uwu",
"*blushes*",
"(*^ω^)",
"(灬´ᴗ`灬)",
"(U ᵕ U❁)",
"( ͡o ᵕ ͡o )",
"( ˊ.ᴗˋ )"
]
remarks = [
"wooks wike you made an ewwow",
... |
class SimpleEvaluator:
"""
SimpleEvaluator is a simple class for evaluating (assigning scores to) benchmarked methods.
"""
def __init__(self):
pass
def get_score(self, proper_answer, answer, completion_time):
"""
Evaluates answer given by the tested method.
In Simpl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.