content
stringlengths
7
1.05M
class Snake: def __init__(self, uuid, name, pos, direction): self.uuid = uuid self.name = name self.body = [pos] self.direction = direction self.length = 6 self.colors = [[100, 100, 100]] self.ticks = 0 def get_head(self): return self.body[-1] ...
class dotPartLine_t(object): # no doc aPoints = None nPoints = None PartID = None PartLineCutted = None PartLineType = None
#: The interval which http server refreshes its routing table HTTP_ROUTER_CHECKER_INTERVAL_S = 2 #: Actor name used to register actor nursery SERVE_NURSERY_NAME = "SERVE_ACTOR_NURSERY" #: KVStore connector key in bootstrap config BOOTSTRAP_KV_STORE_CONN_KEY = "kv_store_connector" #: HTTP Address DEFAULT_HTTP_ADDRESS...
class UserContext: @property def user_id(self) -> int: return self._user_id @property def is_admin(self) -> bool: return self._is_admin def __init__(self, user_id: int, is_admin: bool) -> None: self._user_id = user_id self._is_admin = is_admin
numero = str(input('Digite um numero de 0 a 9999:')) unidade = numero[3] dezena = numero[2] centena = numero[1] milhar = numero[0] print('''unidade:{}, centena:{}, dezena:{}, milhar:{}'''.format(unidade,dezena,centena,milhar))
''' Listas Listas são semelhantes as tuplas, porém, elas são Mutáveis. Além disso as Listas são representadas por '[]' Ex: Lanches = ['Hambunguer', 'Suco', 'Pizza', 'Pudim'] Podemos modificar um item da lista. Ex: Lanches[4] = 'Sorvete' --> Lanches = ['Hambunguer', 'Suco', 'Pizza', 'Sorvete'] Podemos também acrescen...
class PrintDT: def py_data(self,list): self.list=[] print(self.list) def py_data(self,tuple): self.tuple=() print(tuple) def py_data(self,str): self.str='' print(str) p=PrintDT() p.py_data([1,2,3]) p.py_data(('a',[8,4,6],"mouse")) p.py_data('Abhay')
# -*- coding: utf-8 -*- extensions = [ 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', ] #'sphinxcontrib.matlab', #templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'pyrenn' copyright = u'2016, Dennis Atabay' author = u'Dennis Atabay' version = '0.1' release = '0.1' exc...
# -*- coding: utf-8 -*- """English language translation .. module:: client.plugins.syntaxchecker.translation.en.messages :platform: Windows, Unix :synopsis: English language translation .. moduleauthor:: Petr Rašek <bowman@hydratk.org> """ language = { 'name': 'English', 'ISO-639-1': 'en' } msg = { ...
def fatorial(numero=1, show=False): resul = 1 if show == True: for c in range(numero, 0, -1): if c != 1: resul *= c print(f"{c}x", end="") elif c == 1: print(f"{c}", end="") print(f" = {resul}") else: for c in ra...
class ConnectionError(Exception): def __init__(self, *args, **kwargs): pass @staticmethod def __new__(S, *more): """ T.__new__(S, ...) -> a new object with type S, a subtype of T """ pass def __reduce__(self, *args, **kwargs): pass def __str__(self): """...
class Actions: START = 'start' SHUTDOWN = 'shutdown' DELETE = 'delete' HIBERNATE = 'hibernate' RESTORE = 'restore' def __init__(self): return class VolumeActions: ATTACH = 'attach' DETACH = 'detach' RENAME = 'rename' INCREASE_SIZE = 'increase-size' DELETE = 'delete...
num_elves = 3014387 elves = [[1, i + 1] for i in range(num_elves)] while len(elves) > 1: for i in range(len(elves)): if elves[i][0] != 0: elves[i][0] += elves[(i + 1) % len(elves)][0] elves[(i + 1) % len(elves)][0] = 0 elves = [x for x in elves if x[0] != 0] print('The elf wit...
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """ Client support code for Conch. Maintainer: Paul Swartz """
class Node: def __init__(self, data, nextNode): self.data = data self.nextNode = nextNode class Stack: def __init__(self): self.top = None def Peek(self): return self.top def Push(self, data): nextNode = self.top self.top = Node(data, nextNode) de...
# 7. Продолжить работу над заданием. В программу должна попадать # строка из слов, разделённых пробелом. Каждое слово состоит # из латинских букв в нижнем регистре. Нужно сделать вывод # исходной строки, но каждое слово должно начинаться с заглавной # буквы. Используйте написанную ранее функцию int_func(). def is_asci...
def resultado_f1(**podium): for posicao, piloto in podium.items(): print(f'{posicao} --> {piloto}') if __name__ == '__main__': resultado_f1(primeiro='Piloto1', segundo='Piloto2', terceiro='Piloto3')
# coding: utf-8 class GradsCondition(object): def __init__(self, name, values): self.name = name self.values = values if self.name == 'level': self.values = [float(v) for v in self.values] def __eq__(self, other): if isinstance(other, self.__class__): r...
class Solution: def findKthPositive(self, arr: List[int], k: int) -> int: idx = 0 for nxt in itertools.count(1): if idx < len(arr) and arr[idx] == nxt: idx += 1 else: k -= 1 if k == 0: return nxt
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"get_nc_dss": "02_data.news_commentary.ipynb", "get_tatoeba_dss": "02_data.tatoeba.ipynb", "generate_from_strs": "03a_models.patch.ipynb", "gen_attention_mask": "03c_models.bert2gpt...
some_string = input() for letter in some_string: print(letter * 2, end="")
# This is an input class. Do not edit. class LinkedList: def __init__(self, value): self.value = value self.next = None # O(n) time | O(1) space - where n is the number of nodes in the Linked List def removeDuplicatesFromLinkedList(linkedList): currentNode = linkedList while ...
number = int(input()) print(number) print(type(number)) # repl -> repeat evaluate print loop
x=1 y=2 z=3 # # 1s or less # diff_low_t=35 # diff_high_t=255 # target_gray = cv2.cvtColor(anh_phat_hien_crop, cv2.COLOR_BGR2GRAY) # self.previewImage('a', target_gray) # bg_gray = cv2.cvtColor(anh_nen_crop, cv2.COLOR_BGR2GRAY) # self.previewImage('a', bg_gray) # diff_gray = cv2.absdiff(target_gray,bg_gray...
TheClass = """ class TheClass: def theMethod(self): pass def differentMethod(self): pass class DifferentClass: def theMethod(self): pass """ Function = """ def theFunction(): pass """
''' enhanced_multi_table.py Multiplication table printer: Enter the number and the number of multiples to be printed ''' def multi_table(a, n): for i in range(1, n+1): print('{0} x {1} = {2}'.format(a, i, a*i)) if __name__ == '__main__': try: a = float(input('Enter a number: ')) n = f...
def fibonacci(n: int): fibs = [] for i in range(n): if i < 2: fibs.append(i) else: fibs.append(fibs[i - 1] + fibs[i - 2]) return fibs if __name__ == "__main__": ans = fibonacci(15) print(ans)
FIELD = "field" FOREST = "forest" GARDEN = "garden" ORCHARD = "orchard" PASTURE = "pasture" SILVOPASTURE = "silvopasture" TYPES = [ ("F", FIELD), ("W", FOREST), ("G", GARDEN), ("O", ORCHARD), ("P", PASTURE), ("S", SILVOPASTURE) ]
__all__ = ["fibo", "pi"] def fibo(n): return n if n < 2 else fibo(n - 1) + fibo(n - 2) def pi(its): sum = 0 for i in range(its): sum += 1 / (i + 1) ** 2 return (6 * sum) ** 0.5
# Time: f(n) = k * f(n/k) + n/k * klogk <= O(logn * nlogk) <= O(n^2) # n is the length of S, k is the max number of special strings in each depth # Space: O(n) class Solution(object): def makeLargestSpecial(self, S): """ :type S: str :rtype: str """ result ...
''' Problem: For the numbers 1 to 100, print fizz if divisible by 3, bang if divisible by 5. '''
class Solution: def breakPalindrome(self, palindrome: str) -> str: if len(palindrome) == 1: return "" for char in palindrome[: len(palindrome) // 2]: if char != "a": return palindrome.replace(char, "a", 1) return palindrome[:-1] + "b"
cntr = 0 with open('../data/css_comvoi/train.txt', 'r', encoding='utf-8') as f: with open('../data/css10/newtrain.txt', 'w', encoding='utf-8') as f2: for line in f: if cntr % 4 != 3: print(line.rstrip(), file=f2) cntr += 1
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020/8/3 14:54 # @Author : cendeavor # @File : dto.py # @Software: PyCharm class ResultDO: def __init__(self, code, msg, data): self.code = code # 状态码 self.msg = msg # 提示信息 self.data = data # 返回的数据 def to_dict(self): ...
Numbers = [] while True: try: V = float(input('')) D = float(input('')) R = D / 2 A = 3.14 * (R ** 2) H = V / A print('ALTURA = %0.2f' %H) print('AREA = %0.2f' %A) except EOFError: break
i2 = input() d2 = input() s2 = input() print(i+int(i2)) print(d+float(d2)) print(s + s2)
def next_pws(pw): while True: idx = -1 while pw[idx] == 'z': pw[idx] = 'a' idx -= 1 pw[idx] = chr(ord(pw[idx]) + 1) yield pw has_increasing_straight = lambda pw_nums: ( any(a == b-1 == c-2 for a, b, c in zip(pw_nums, pw_nums[1:], pw_nums[2:]))) has_invali...
""" Workbench CLI Version """ __version_info__ = (0, 3, 3) __version__ = '.'.join(map(str, __version_info__))
""" 0500. Keyboard Row Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Example: Input: ["Hello", "Alaska", "Dad", "Peace"] Output: ["Alaska", "Dad"] Note: You may use one character in the keyboard more than once. You ...
# 1st solution # O(n) time | O(n) space class Solution: def findJudge(self, n: int, trust: List[List[int]]) -> int: table = [[0, 0] for _ in range(n + 1)] for a, b in trust: table[a][0] += 1 table[b][1] += 1 judges = [] for i in range(1, n + 1): if...
class Automaton: # finals_states: finals states array # transitions: tuples array (first, c, ends_array) first -> c -> endi, # c is the transition character and endi belongs to ends array def __init__(self, states, start_state, finals_states, transitions): self.states = states self.tags ...
######################################################################## # amara/writers/htmlentities.py """ This module defines the entities for HTML 3.2, HTML 4.0 and XHTML 1.0. """ __all__ = ['ENTITIES_HTML_32', 'ENTITIES_HTML_40', 'ENTITIES_XHTML_10'] # HTML 3.2 defined character entities ENTITIES_HTML_32 = { ...
# Write a program that reads numbers from the user until a blank line is entered. # Your program should display the average of all of the values entered by the user. # Then the program should display all of the below average values, followed by all of the average values (if any), # followed by all of the above avera...
test = { 'name': 'q8_8', 'points': 1, 'suites': [ { 'cases': [ { 'code': ">>> # Please actually go on Piazza and look at the threads.;\n>>> # Looks like you didn't make a string.;\n>>> type(secret) == str\nTrue", 'hidden': False, ...
#======== أنواع البيانات في لغة البرمجة بايثون =========# # يوجد العديد من أنواع البيانات المعرفة مسبقا في لغة البرمجة بايثون سنتطرق للبيانات الأساسية والتي يمكن تقسيمها كالتالي: # 1- أنواع البيانات العددية: ## أ) الأعداد الصحيحة x = 105 ## ب) الأعداد ذات الفاصلة العائمة x = 10.5 ## ج) الأعداد المركبة x = 10j ## د) قي...
""" Configuration Constants for package use. """ # ------------------------- # API Base URL # ------------------------- # default API URL for v0 API_BASE_URL = "https://api.letterboxd.com/api/v0" # TODO: Move the LBXD_API_KEY and LBXD_API_KEY in here?
class BaseETL: def __init__(self, base_url, access_token, s3_bucket): self.base_url = base_url self.access_token = access_token self.s3_bucket = s3_bucket def files_to_submissions(self): pass def submit_metadata(self): pass
num = int(input("Enter a number: ")) count = 0 i = 2 while (i <= num / 2): if (num % i) == 0: count = count + 1 break i = i + 1 if (count == 0 and num != 1): print(f" {num} is a prime number") else: print(f"{num} is not a prime number")
''' Created on 06.02.2020 @author: JM ''' class TMC4330_fields(object): """ Define all register bitfields of the TMC4330. Each field is defined as a tuple consisting of ( Address, Mask, Shift ). The name of the register is written as a comment behind each tuple. This is intended for IDE users vi...
yaw_kp = 0.47 yaw_setpoint = 0.0 roll_kp = 0.38 roll_setpoint = 0.0 pitch_kp = 0.32 pitch_setpoint = 0.0 range_kp = 0.09 range_setpoint = 0.0 horizontal_kp = 0.45 horizontal_setpoint = 0.0 vertical_kp = 0.18 vertical_setpoint = 0.0
""" ======= 旋转数组 ======= 给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。 """ def basic(nums, k): if k == 0 or len(nums) == 0: return nums offset = k % len(nums) reversed_num = list(reversed(nums)) return list(reversed(reversed_num[0:offset])) + list(reversed(reversed_num[offset:]))
class ApiError(Exception): def __init__(self, code, message): self.code = code self.message = message def __repr__(self): return self.__str__() def __str__(self): return repr(self.message)
username = 'XXXXXXXXX' #your username password = 'YYYYYYYYYYYYY' #your password #Here, your username and pw are asked not to be intrusive, but just because ig hates #other ways than the app to post pictures. #So there is no official API Keys to use. Sorry for that.
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. class GetLinuxSupportUser2FAResult(object): """Implementation of the 'GetLinuxSupportUser2FAResult' model. Attributes: email_id (string): TODO: Type Description here. to_tp_qr_code_url (string): TODO: Type Description here. to_tp...
input=str(input()) # print(len(input)) def getRes(input): for i in range(0,len(input)): # print("i=",input[i]) if(int(input[i])%8==0): print("YES") print(input[i]) return for j in range(i+1,len(input)): a=10*int(input[i])+int(input[j]) ...
__author__ = 'krasnykh' class Film(object): def __init__(self, name = "", aka = "", year = "", duration = "", rating = "", notes = "", text_languages_0 = "", subtitles = "", audio = "", video = "", country = "", genres = "", music = ""): self.name = name self.aka = aka self.year = year ...
# # @lc app=leetcode id=590 lang=python3 # # [590] N-ary Tree Postorder Traversal # # @lc code=start # Definition for a Node. class Node: def __init__(self, val=None, children=None): self.val = val self.children = children class Solution: def postorder(self, root): ls = [] de...
""" New Driver's License You have to get a new driver's license and you show up at the office at the same time as 4 other people. The office says that they will see everyone in alphabetical order and it takes 20 minutes for them to process each new license. All of the agents are available now, and they can each see one...
def application(environ, start_response): body = [] content_length = 0 for l in environ['wsgi.input'].__iter__(): body.append(l) content_length += len(l) start_response( '200', [ ('Content-Length', str(content_length)), ('X-Lines-Count', str(len(...
# automatically generated by the FlatBuffers compiler, do not modify # namespace: flat class GameMode(object): Soccer = 0 Hoops = 1 Dropshot = 2 Hockey = 3 Rumble = 4
class Solution: def reverseBits(self, n: int) -> int: res = 0 for _ in range(32): tmp = n & 0x80000000 tmp = 1 if tmp else 0 n <<= 1 if tmp: res += 2 ** _ print(bin(res)) return res
class Hyperparameters(): def __init__(self): self.IMAGESIZE = [30,30] self.MEAN_REWARD_BOUND = 19.0 self.CHANNEL_NUM = 4 self.ACTION_SPACE = 6 self.GAMMA = 0.99 self.BATCH_SIZE = 32 self.REPLAY_SIZE = 10000 self.REPLA...
def sayHello1(name): print(f"hello to {name}") sayHello1("Atilla") sayHello1("Duru") sayHello1("") #sayHello1() # TypeError: sayHello1() missing 1 required positional argument: 'name' sayHello1(name = "Atilla")
class Interface: def __init__(self, name, operations): self.name = name self.operations = operations
""" @Time : 2019/1/10 16:39 @Author : Sam @Project : IEC101 @FileName: Struct.py @Software: PyCharm @Blog : https://blog.muumlover.com """ class DIRType(object): """ 报文方向位(DIR) 在监视方向的过程信息 """ # 表示上行报文,即报文从配电终端发往主站 UpLoad = 0 # 表示下行报文,即报文从主站发往配电终端 DownLoad = 1 class PRMType(ob...
permutations = [ '(0, 0, 4φ, 2φ4)', '(2+φ, 2+φ, 2+5φ, 2+5φ)', ] for permutation in permutations: prefix = 'four::combinatorics::PermutationSeed<float>{ ' postfix = ', true, four::combinatorics::Parity::ALL },' formatted = '' for i in range(len(permutation)): if permutation[i] == '(': formatted += '{' eli...
list = [5, 10, 15, 20, 25, 50, 20] for i in range(len(list)): if list[i] == 20: list[i] = 200 print(list) print(list[2:6])
# Declare Variables Here binary = "binary" do_not = "don't" hilarious = False joke_evaluation = "Isn't that joke so funny?! %r" # Print Strings Here x = "There are %d types of people" % 10 y = "Those who know %s and those who %s." % (binary, do_not) w = "This is the left side of " e = "a string with a right side." ...
# -*- coding: utf-8 -*- class Solution: def getMaximumGenerated(self, n: int) -> int: nums, result = [0] * (n + 1), 0 for i in range(1, n + 1): if i == 1: nums[i] = 1 elif i % 2 == 0: nums[i] = nums[i // 2] elif i % 2 == 1: ...
class Solution: def modifyString(self, s: str) -> str: sl=list(s) for i in range(len(sl)): if sl[i]=='?': if i==0 or sl[i-1]!='a': sl[i]='a' else: sl[i]='b' if i!=len(sl)-1 and sl[i+1]==sl[i]...
# training data: texts, heads and dependency labels # for no relation, we simply chose an arbitrary dependency label, e.g. '-' # Labels: [ROOT, NOUN, TO, WHEN, BODY] # The following dataset follows the following dependency ordering. # The ordering has priority here # ROOT -> ROOT # NOUN -> ROOT # TO -> NOUN/ROOT # ...
message = input('Digite algo: ') print('O tipo primitivo da mensagem {} é: {}'.format(message, type(message))) print('Só tem espaços? {}'.format(message.isspace())) print('É um número? {}'.format(message.isnumeric())) print('É alfabético? {}'.format(message.isalpha())) print('É alfanumérico? {}'.format(message.isalnum(...
_sensor_mode_to_resolution = { 0: None, 1: '1920x1080', 2: '3280x2464', 3: '3280x2464', 4: '1640x1232', 5: '1640x922', 6: '1280x720', 7: '640x480', } _sensor_mode_to_framerate = { 0: None, 1: 24, # Maximum is 30 2: 10, # Maximum is 15 3: 10, # Maximum is 15 4: 15,...
class School: class_roster = [] def __init__(self): pass def add_student(self, name, grade): self.name = name self.grade = grade return True def roster(self): name = self.name return self.class_roster def grade(self, grade_number): ...
# with open() # f = open('data/fairy_tale_1.txt', 'r', None, 'utf-8') # f = open(file='data/fairy_tale_1.txt', mode='r', encoding='utf-8') # f = open(mode='r', file='data/fairy_tale_1.txt', encoding='utf-8') # f = open('data/fairy_tale_1.txt', 'r', encoding='utf-8') # Ф И О # Иванов Иван Иванович # key value ...
# model settings seed = 1024 num_sclies_one_img=3 cfg_3dce = dict( samples_per_gpu=20, num_slices=3, num_images_3dce=1, img_do_clip=True, windowing=[-1024, 3071], norm_spacing=0.8, max_size=512, #to do slice_intervals=2., image_path='./datasets/deeplesion/Images', val_avg_fp=[0....
while True : num = str(input('Enter two digit number here : ')) if len(num)==2 : result = int(num[0]) + int(num[1]) print(result) break else : print('Please enter two digit number !')
""" Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ class Solution: """ @param root: param root: The root of the binary search tree @param k1: An integer @param k2: An integer @return: return: Return all keys...
''' Created on 10-Dec-2020 @author: couchbase ''' spec = { # Accepted values are > 0 "max_thread_count" : 25, # Accepted values are 0 or any positive int. 0 and 1 means no dataverse will be created and Default dataverse will be used. "no_of_dataverses" : 25, # Accepted values are 0 or any...
def leerTablero(ruta): with open(ruta, "r") as f: tablero = [] for line in f: linea = [] for campo in line.split(","): linea.append(campo.split("\n")[0] if campo != "\n" else " ") tablero.append(linea) return tablero
"""gbooru_images_download - Serve booru for hydrus""" __version__ = '0.0.1' __author__ = 'Rachmadani Haryono <foreturiga@gmail.com>'
""" 863. All Nodes Distance K in Binary Tree Example 1: Input: root = [3,5,1,6,2,0,8,null,null,7,4], target = 5, K = 2 Output: [7,4,1] Explanation: The nodes that are a distance 2 from the target node (with value 5) have values 7, 4, and 1. """ """ Solution DFS: 不可以杂交 比如: l = dfs(l.left, K, dis...
class Solution: def findLUSlength(self, a: str, b: str) -> int: ''' God, this solution was so simple but I over-thought it. Consider the following: 1. The strings are the same There can be no uncommon subsequence, return -1 2. The strings are the same ...
class MyClass: x=3 y=4 def __init__(self): print("in constructor") def classMemberFunc(self): print(self.x) def myFunc(in1,in2): print("in function") return in1+in2 print("hello world") x=3 y=x+4 print(y) floatDiv = 7 / 3 # 2.3 intDiv = 7 //3 # 2 exp = 2 ** 4 # 16 print("The exponentiated value is " + s...
global grits_diagnose_next_status grits_diagnose_next_status = 'success' def make_next_test_fail(): global grits_diagnose_next_status grits_diagnose_next_status = 'failure' # Simple mocking of the grits-api package def handleDiagnosis(*arg, **kw): global grits_diagnose_next_status stat = grits_dia...
""" Write program, that will count the sum of all numbers from 1 to number that was entered by user. 1,2,3,4,5,... 100 (1 + 100) / 2 * 100 For 5: 1+2+3+4+5 the result is gonna be: 15 (1 + 5) / 2 * 5 = 15 range(1, 6) 1,2,3,4,5 """ def sum_up_to(end): sum = 0 # 15 for number in range(1, end+1): #number = ...
#!/usr/bin/env python # -*- coding: utf-8 -*- class PkgEnv(object): def __init__(self, conanfile): self.conanfile = conanfile self.env = {} def add_pkg(self, dep_name, **args): deps = self.conanfile.deps_cpp_info[dep_name] CFLAGS = " -I".join([""] + deps.include_paths) ...
# 총 복잡도 O(n^0.5) a,b = list(map(int,input().split())) is_prime = [True] * (b+1) # 1은 소수에 포함되지 않는다 is_prime[1] = False for i in range(2, int(b**0.5)+1): # 이미 False로 판별된 경우에는 계산 대상에서 제외 if is_prime[i]: # 소수(i)의 제곱수 이후 배수들을 모두 리스트에서 제거 -> 중복계산 방지 is_prime[(i**2)::i] = [False] * ((b - i**2) // i + 1...
# Clean up the class to make it more pythonic class MyDemoClass(object): def __init__(self, data, filename="names.txt"): self._data = data self._filename = filename self._file_contents = "" def set_data(data): self.data = data def get_data(data): return self.data ...
#!/usr/bin/python ''' This is a test file to see if it is possible to have a python file with all the permanent variables for potato (S. tuberosum) which can then be imported into individual scripts when required. ''' # A dictionary containing the background frequencies of all bases # The background is considered to...
# Copyright (c) Jeremías Casteglione <jrmsdev@gmail.com> # See LICENSE file. SUPPORTED = { 'debian': True, }
# -*- coding: utf-8 -*- DEFAULT_FIELDS = [ 'timestamp', 'distance', 'temperature', 'heartratebpm', 'cadence', 'power', 'altitude', 'speed', 'latitude', 'longitude', ]
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- # Description: Get the intersection of two line segment # Date: 09/Dec/2021 # Author: Steven Huang, Auckland, NZ # Copyright (c) 2020-2021, Steven Huang # License: MIT License class GetLineSegInterPoint(): def __init__(self, line1, line2): self.line1 = line...
class HtmlWindowCollection(object, ICollection, IEnumerable): """ Represents the windows contained within another System.Windows.Forms.HtmlWindow. """ def GetEnumerator(self): """ GetEnumerator(self: HtmlWindowCollection) -> IEnumerator Returns an enumerator that can iterate through ...
class Cuenta_bancaria: def __init__(self, ID, nombre_titular, fecha_de_apertura, numero_cuenta, saldo): self.ID = ID self.nombre_titular = nombre_titular self.fecha_de_apertura = fecha_de_apertura self.numero_cuenta = numero_cuenta self.saldo = saldo def get_saldo(self):...
class LoginError(Exception): def __init__(self, addr, user): msg = f"{user} failed auth to server {addr}" super().__init__(msg) class WorkflowStateNotSetError(Exception): def __init__(self, module_name): msg = f"WorkflowState is not set in {module_name}" super().__init__(msg) ...
"""Top-level package for vplatoon.""" __author__ = """Andres Ladino""" __email__ = 'aladinoster@gmail.com' __version__ = '0.3.0'
n = int(input()) list_odd = [] list_even = [] if n >= 1: for i in range(n): t = int(input()) if t % 2 > 0: list_odd.append(t) else: list_even.append(t) list_odd.sort(reverse=True) list_even.sort() print(list_even + list_odd)
samp_string = "Whatever you are, be a good one." # # You can get a character by referencing an index # print(samp_string[0]) # # # Get the last character # print(samp_string[-1]) # # # Get the string length # print("Length : ", len(samp_string)) # # # Get a slice by saying where to start and end # # The 4th index isn'...
class Mymother(object): def __init__(self): self.num1 = 10 print("I am a Mother class constructor") def mydisplay_mother(self): print("I am a Mother class instance method") class MyDaughter(Mymother): def mydisplay_Daughter(self): print("I am a Daughter class instan...