content
stringlengths
7
1.05M
class PaireGraphs: def __init__(self,graphe1, graphe2, matching): self.premierGraphe = graphe1 self.secondGraphe = graphe2 self.matching = matching
# Variable declaration myName = 'Dany Sluijk'; myAddress = 'Nijenoord 9'; result = 'Ik ben ' + myName + ' en mijn adres is: ' + myAddress; print(result);
""" Demonstrates list functions. """ values = [6, 3, 1, 2] #A list named values containing 6, 4, 3, 1, 5 and 2 values.insert(1, 4) #Inserts 4 at index 1 print("values:", values) #Prints the values list (in list form) values.insert(4, 5) #Inserts 5 at index 4 p...
print("Hello World!!") print() print('-----------------------') print() print(note := 'lets create a string') print(some_string := 'this is a string') try: # index starts from 0 thus len -1 if some_string[len(some_string) - 1] == 'g': print(note := 'this shall be executed') except IndexError: pri...
class Solution: def eliminateMaximum(self, dist: List[int], speed: List[int]) -> int: for i, arrivalTime in enumerate(sorted([(d - 1) // s for d, s in zip(dist, speed)])): if i > arrivalTime: return i return len(dist)
"""Lambdata - a collection of Data Science helper functions""" # # accessing libraries through pipenv # import pandas as pd # import numpy as np COLORS = ["cyan", "teal", "mauve", "blue", "crimson"] FAVORITE_NMBERS = [2.71, 101, 55, 12, 3.14] def increment(x): return x + 1 # # Implement your helper functions #...
#!/usr/bin/env python # coding:utf8 class LazySingleton(object): __instance = None @classmethod def getInstance(cls): if LazySingleton.__instance is None: LazySingleton.__instance = object.__new__(cls) return LazySingleton.__instance def check(self): print("the in...
# GENERATED VERSION FILE # TIME: Tue Dec 28 10:55:50 2021 __version__ = '1.0.0+8da4630' short_version = '1.0.0'
def addNums(x, y): """ Add two numbers together """ return x + y def subtractNums(x, y): """ subtract two numbers and return result """ return y - x
def fibg(max): n , a, b = 0,0,1 while n<max: yield b a,b = b,a+b n = n+1 return 'done' # for i in fibg(5): # print(i) def odd(): print('step 1') yield 1 print('step 2') yield 3 print('step 3') yield 5 # o = odd() # print(next(o)) # print(next(o)) # pri...
def arr2bin(arr): total = 0 for a in arr: if not type(a) == int: return False total += a return '{:b}'.format(total)
def main(): matriz = [[{ },{ },{ }], [{ },{ },{ }], [{ },{ },{ }]] print("---------- JOGUINHO DA VELHA MAROTO -----------") for linha in range(len(matriz)): for coluna in range(len(matriz[linha])): #CONTROLAR ERRO DE POSIÇÃO PREENCHIDA cont = 0 ...
num1 = 111 num2 = 222 num3 = 3333333 num4 = 4444
'''Crie uma função que multiplique dois números e apresente o resultado. Crie a função main. Esta função essa terá parâmetro.''' def Numerosdaformula(a,b):# a = n1 e b = n2 r = a * b print('Resultado: ',r) #A diferênça entre elas está na declaração dos parâmetros def main(): n1 = int(input('Digite um valo...
N, M = map(int, input().split()) if M == 1 or M == 2: print('NEWBIE!') elif 2 < M <= N: print("OLDBIE!") else: print("TLE!")
# # Print elements of a tuple or a default message # Used a lot in CodinGame Clash of Code # # Tuple of elements a = tuple(range(5)) # Unpack the elements of a # >>> print(*a) # 0 1 2 3 4 # If a is empty, *a = False # Therefore, unpack the elements inside ["None"], therefore "None" print(*a or ["None"]) # # Transp...
class HumanHandover: """ TODO: Not yet implemented """ def __init__(self, operators=None): self.operators = operators if operators else [] def register_operator(self): raise NotImplementedError def remove_operator(self, telegram_chat_id): raise NotImplementedError
list = [[],[]] for v in range(1,8): numero = int(input(f"Digite o {v}o. valor: " )) if numero%2 == 0: list[0].append(numero) else: list[1].append(numero) print(f'Os valores pares digitados foram: {sorted(list[0])}') print(f'Os valores impares digitados foram: {sorted(list[1])}')
def test_docker_running(host): docker = host.service("docker") assert docker.is_enabled assert docker.is_running def test_swarm_is_active(docker_info): assert "Swarm: active" in docker_info
# weird string case from codewars 6 kyu # def to_weird_case(string): #TODO new_str = '' word_index = 0 current_index = 0 while current_index != len(string): print(f'word_index: {word_index}, stringval: {string[current_index]} ') if string[current_index] == ' ': ...
class QuizBrain: def __init__(self,question_list): self.question_list = question_list self.question_number = 0 self.user_score = 0 def next_question(self): current_question = self.question_list[self.question_number] self.question_number += 1 user_answer = input(...
swagger_file_content = ''' swagger: '2.0' info: description: Estuary agent will run your shell commands via REST API version: 4.4.0 title: estuary-agent contact: name: Catalin Dinuta url: 'https://github.com/dinuta' email: constantin.dinuta@gmail.com license: name: Apache 2.0 url: 'http://...
# 07_Faça um algoritmo para ler o salário de um funcionário e aumentá-Io em 15%. # Após o aumento, desconte 8% de impostos. Imprima o salário inicial, o salário # com o aumento e o salário final. salario = float(input('Salário do colaborador: ')) aumento = (salario * 15)/100 salario_aumento = (aumento + salario) de...
ip=input().split() key=input() n='' for i in ip: for j in i: if j in key: n+=j l=list(key) s=[[]] for i in range(len(l)+1): for j in range(i+1,len(l)+1): s.append(l[i:j]) print(s)
# Copyright 2021 IBM 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/LICENSE-2.0 # # Unless required by applicable law or agreed t...
''' The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p...
#!/usr/bin/python # encoding=utf-8 """ @Author : Don @Date : 2020/12/25 9:53 @Desc : """
for i in range(1, 10+1): if i%3==0: print(i)
N = int(input()) m = 1000000007 dp = [0] * 10 dp[0] = 1 for _ in range(N): for i in range(8, -1, -1): for j in range(i + 1, 10): dp[j] += dp[i] dp[j] %= m print(sum(dp) % m)
# # PySNMP MIB module HH3C-DLDP2-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-DLDP2-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:26:06 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
""" This is my first prime number project, it is not fast but it will work properly. It will find all prime numbers between 2 and 'End'. 1. At first we create an Prime array to store 2, 3 and all numbers between 3 and 'End' if number is odd and it is not divided by 3 2. Then we create a copy of Prime, because we wan...
# # PySNMP MIB module KEEPALIVED-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/KEEPALIVED-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:04:49 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isSymmetric(self, root: TreeNode) -> bool: return self.isSymmetricRecu(root,root) ...
# Variable score contains the user's answers score = 0 # Function contains the Intro to the program def intro(): print("How much money do you owe the IRS? Find out with this short quiz!") print("Respond with the number of each answer.") print("Entering anything other than a number will break the program!")...
# Given a list of words, find all pairs of unique indices such that the concatenation of # the two words is a palindrome. # For example, given the list ["code", "edoc", "da", "d"], return [(0, 1), (1, 0), (2, 3)] words = ["code", "edoc", "d", "cbaa", "aabc", "da"] # Brute force # O(n^2 X c) wher n is the number of ...
class InlineCollection(TextElementCollection[Inline],IList,ICollection,IEnumerable,ICollection[Inline],IEnumerable[Inline]): """ Represents a collection of System.Windows.Documents.Inline elements. System.Windows.Documents.InlineCollection defines the allowable child content of the System.Windows.Documents.Paragraph,...
""" Non-negative 1-sparse recovery problem. This algorithm assumes we have a non negative dynamic stream. Given a stream of tuples, where each tuple contains a number and a sign (+/-), it check if the stream is 1-sparse, meaning if the elements in the stream cancel eacheother out in such a way that ther is only a uniq...
def my_zip(first,secoud): first_it=iter(first) secoud_it=iter(secoud) while True: try: yield (next(first_it),next(secoud_it)) except StopIteration: return a=['s','gff x','c'] b=range(15) m= my_zip(a,b) for pair in my_zip(a,b): print(pair) a,b...
def AddOne(value, value1=100): return value + value1 print(AddOne(abcd=200))
'''Faça um programa que leia 5 valores numéricos e guarde-os em uma lista. No final, mostre qual foi o maior e o menor valor digitado e as suas respectivas posições na lista''' print('\033[1;33m-=\033[m' * 20) lista = [] mai = [] men = [] for c in range(0, 5): lista.append(int(input('\033[34mDigite um valor:\033[m ...
def get_default_value(typ): if typ == int: return 0 else: return typ.default() def type_check(typ, value): if typ == int: return isinstance(value, int) else: return typ.value_check(value) class AbstractListMeta(type): def __new__(cls, class_name, parents, attrs): ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
def city_country(city, country, population=None): if population: city_country_formatted = f"{city.title()}, {country.title()} - população {population}" else: city_country_formatted = f"{city.title()}, {country.title()}" return city_country_formatted
''' Author : MiKueen Level : Easy Problem Statement : Count Primes Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. ''' class Solution: def countPrimes(self, n: int) -> int: if n <=...
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Author : revang Date : 2022-01-01 18:47:20 Last Modified by : revang Last Modified time: 2022-01-01 18:47:20 """ def list_split(list_collection, num): """ 将集合均分,每份n个元素 :param list_collection: :param num: :return: 返回的结果为均分后的...
#((power/25)*((year-1900)/4)*((speed/100)^2)*(capacity/50))/speed def cost(): power = int(input("Power: ")) speed = int(input("Speed: ")) year = int(input("Year: ")) capacity = int(input("Capacity: ")) loadspeed = int(input("Loading Speed: ")) print(int(((power/25)*((year-1900)/4)*(int(speed/100)^2)*(capacity/50...
frase = str(input('Digite uma frase: ')).strip().upper() palavras = frase.split() junto = ''.join(palavras) inverso = '' for i in range(len(junto)-1, -1 , -1): inverso += junto[i] if junto == inverso: print('A frase é um palindromo') else: print('Nao e um palindromo')
WORKFLOW='inversion' # inversion, migration, modeling SOLVER='specfem2d' # specfem2d, specfem3d SYSTEM='slurm_sm' # serial, pbs, slurm OPTIMIZE='LBFGS' # base PREPROCESS='base' # base POSTPROCESS='base' # base MISFIT='Waveform' MATERIALS='Elastic' DENSITY='Constant' # WORKFLOW BEGIN=1 ...
n = int(input("digite um número:")) n1 = 1 n2 = 2 soma = 1 while soma != 0 and n != 0: n1 = n % 10 n = n // 10 soma = n1 - n2 n2 = n % 10 n = n // 10 if soma == 0: print("Há números adjacentes iguais.") else: print("Não há números adjacentes iguais")
""" all the text used in the app """ # LOADING SCREEN load_title = "LOADING..." # Hiragana to Romaji screen h2r_input_tip = "type transliteration" h2r_button_help = "Show (F1)" h2r_button_check = "Confirm (ENTER)" h2r_button_quit = "Quit (ESC)"
schedule = { # "command name": interval[minutes], "toredabiRoutine": 15, }
class Solution: def movesToStamp(self, stamp: str, target: str) -> List[int]: n, m, t, s, res = len(target), len(stamp), list(target), list(stamp), [] def check(i): changed = False for j in range(m): if t[i + j] == '?': continue if t[i + j] !=...
n = input().split() for index, i in enumerate(n): n[index] = int(i) limite = n[1] leituras = n[0] lista = [] c = 0 b = False for e in range(leituras): temp = input().split() temp[0] = int(temp[0]) temp[1] = int(temp[1]) lista.append(temp[0]) lista.append(temp[1]) for index, k in enumerate(lista): ...
# by Kami Bigdely # Extract Variable (alias introduce explaining variable) WELL_DONE = 900000 MEDIUM = 600000 COOKED_CONSTANT = 0.05 def is_cookeding_criteria_satisfied(order): if order.desired_state() == 'well-done' and order.time() * order.temperature() * order.pressure() * COOKED_CONSTANT >= WELL_DONE: ...
def estCondicional01(): #Definir variables u otros montoP=0 #Datos de entrada cantidadx=int(input("Ingrese cantidad de lapices: ")) #Proceso if cantidadx>=1000: montoP=cantidadx*0.80 else: montoP=cantidadx*0.90 #Datos de salida print("El monto a pagar es:", montoP) estCondicional01()
"""Semantic Versioning Helper for Python Errors """ __author__ = 'Oleksandr Shepetko' __email__ = 'a@shepetko.com' __license__ = 'MIT' class InvalidRequirementString(Exception): pass class InvalidVersionIdentifier(Exception): def __init__(self, v: str): self._v = v def __str__(self) -> str: # ...
class Kierowca: def __init__(self, id, nazwisko, imie, kraj): self.id = id self.nazwisko = nazwisko self.imie = imie self.kraj = kraj def __str__(self): return "Kierowca id: " + self.id + ", nazwisko: " + self.nazwisko + ", imie: " + self.imie + ", kraj: " + self.kraj ...
def run(): #lista=[] #for i in range(1,101): # if(i%3!=0): # lista.append(i**2) lista=[i**2 for i in range(1,101) if i%3 !=0] #[element for elemento in irable if condicion] lista2=[i for i in range(1,9999) if(i%4==0 and (i%6==0 and i%9==0)) ] print(lista) if __name...
#!/usr/bin/env python def calcSumi(n): sumi = 0 for i in range(n): sumi += i return sumi def calcSumiSq(n): sumiSq = 0 for i in range(n): sumiSq += i*i return sumiSq def calcSumTimes(releaseTimes): sumTimes = 0 for time in releaseTimes: sumTimes += time retu...
""" Defines overloaded operators for basic mathematical operations over unit-containing members (Constant, Parameter, Variables) """ class UnexpectedObjectDeclarationError(Exception): """ Error raised by the utilization of a non-registered Varaible, Parameter or Constant for the current Model. """ de...
# -*- coding: utf-8 -*- # Copyright 2008 Matt Harrison # Licensed under Apache License, Version 2.0 (current) __version__ = "0.2.5" __author__ = "matt harrison" __email__ = "matthewharrison@gmail.com"
def rectangle(length: int, width: int) -> str: if not all([isinstance(length, int), isinstance(width, int)]): return "Enter valid values!" area = lambda: length * width perimeter = lambda: (length + width) * 2 return f"Rectangle area: {area()}\nRectangle perimeter: {perimeter()}" print(rectang...
# -*- coding: utf-8 -*- class AsyncyError(Exception): def __init__(self, message=None, story=None, line=None): super().__init__(message) self.message = message self.story = story self.line = line class AsyncyRuntimeError(AsyncyError): pass class TypeAssertionRuntimeError(A...
class BSTNode: def __init__(self, val: int=None): self.left = None self.right = None self.val = val def insert(self, val: str): """[Uses Binary Search Tree Algorithm to insert Data] Args: val (int): [int Value for binary tree insertion 1] """ ...
def calculate_amortization_amount(principal: float, interest_rate: float, period: int) -> float: """ Calculates Amortization Amount per period :param principal: Principal amount :param interest_rate: Interest rate per period :param period: Total number of period :return: Amortization amount per...
#!/usr/bin/python # Copyright (c) 2014 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Class containing options for command filtering.""" class CommandOptions(object): def __init__(self, work_dir, clobber_workin...
def readFile(): #this function to read the file and check if its readable then print it file = open("in.txt", "r") if file.mode =='r': content = file.readlines() print(content) def wordExtract(): #this function to read the file and print specific word nutList = ["energy","total f...
def get_unique_paris(int_list, pair_sum): stop_index = len(int_list) - 1 unique_paris_set = set() for cur_index in range(stop_index): num_1 = int_list[cur_index] num_2 = pair_sum - num_1 remaining_list = int_list[cur_index+1:] if num_2 in remaining_list: pair = (n...
# Python lambda functions or anonymous functions sum = lambda x, y: x + y print(f'The sum is: {sum(45, 25)}')
class LifeState: def size(self) -> int: pass def value(self, x: int, y: int) -> int: pass def evolve(self) -> 'LifeState': pass
"""578. Lowest Common Ancestor III """ """ Definition of TreeNode: class TreeNode: def __init__(self, val): this.val = val this.left, this.right = None, None """ class Solution: """ @param: root: The root of the binary tree. @param: A: A TreeNode @param: B: A TreeNode @return: ...
class List: def __init__(self, client): self.client = client self._title = None self._item = None self.endpoint = None @property def title(self): return self._title @title.setter def title(self, value): self._title = value self.endpoint = f"...
# -*- coding: utf-8 -*- #/////////////////////////////////////////////////////////////// #--------------------------------------------------------------- # File: __init__.py # Author: Andreas Ntalakas https://github.com/antalakas #--------------------------------------------------------------- #////////////////////...
QUOTES = [ ('Diga-me e eu esquecerei. Ensina-me e eu lembrarei. Envolva-me e eu aprenderei.', 'Benjamin Franklin'), ('Desenvolva uma paixão pela aprendizagem. Se você fizer isso, você nunca deixará de crescer.', 'Anthony J. D\'Angelo'), ('Pesquisar é criar novo conhecimento.', 'Neil Armstrong'), ('O pod...
# numbers = dict(first=1, second=2, third=3, fourth=4) # print(numbers) # squared_numbers = {key: val**2 for key, val in numbers.items()} # print('squared_numbers', squared_numbers) # numbers = dict(first=1, second=2, third=3, fourth=4) # add2numbers = {} # print(numbers) # for key, val in numbers.items(): # prin...
# jeżeli jesteś w środku, broń się if self.location == rg.CENTER_POINT: return ['guard'] # LUB # jeżeli jesteś w środku, popełnij samobójstwo if self.location == rg.CENTER_POINT: return ['suicide']
#!/usr/local/bin/python3 def tag_bloco(texto, classe='success', inline=False): tag = 'span' if inline else 'div' return f'<{tag} class={classe}>{texto}</{tag}>' if __name__ == '__main__': print(tag_bloco('teste1')) print(tag_bloco('teste2', inline=True)) print(tag_bloco('teste3', classe="danger"...
class graph(): def __init__(self): self.number_of_nodes = 4 self.distance = { 0: { 0: 0, 1: 34, 2: 56, 3: 79 }, 1: { 0: 45, 1: 0, 2: 13, 3: 77 ...
class Solution: def isAnagram(self, s: str, t: str) -> bool: dic = {} for c in s: dic[c] = dic.get(c, 0) + 1 for c in t: if c not in dic: return False dic[c] -= 1 if dic[c] < 0: return False return not su...
a=input("enter first number") b=input("enter second number") c=float(a) d=float(b) e=c*d print(e)
day_num = 6 file_load = open("input/day6.txt", "r") file_in = file_load.read() file_load.close() file_in = file_in.split("\n\n") def run(): def yes(input_in): group_ans = [set(temp_group.replace("\n","")) for temp_group in input_in] group_total = 0 for temp_group in group_ans: group_total +...
n=int(input("Enter a digit from 0 to 9:")) if n==0: print("ZERO") elif n==1: print("ONE") elif n==2: print("TWO") elif n==3: print("THREE") elif n==4: print("FOUR") elif n==5: print("FIVE") elif n==6: print("SIX") elif n==7: print("SEVEN") elif n==8: print("EIGHT...
""" Resolva essa expressão: 100−413 ⋅ (20−5×4) 5 """ resultado = (100 / 5 - 413 / 5) * ((20 - 5 * 4) / 5) print(resultado)
def plus_proche_method_2(list, force): for i in range(len(list)): key = list[i] j = i - 1 while j >= 0 and key < list[j]: list[j + 1] = list[j] j -= 1 list[j + 1] = key for i in range(len(list)): if list[i] == force: if i == 0: ...
""" This script is used to launch data and vis services, and the start the experiment script. It accept a path to experiment launch file: python launch_realtime_vis.py D:\projects\python\maro\examples\hello_world\cim\hello.py maro vis service start/stop maro start path/exp steps: 1. launch the servcies' dock...
def has_period(self): """Indicates if an axis has symmetries. Parameters ---------- self: DataPattern a DataPatternobject Returns ------- Boolean """ return False
### Model data class catboost_model(object): float_features_index = [ 1, 3, 9, 11, 13, 15, 19, 23, 32, 39, 47, ] float_feature_count = 50 cat_feature_count = 0 binary_feature_count = 11 tree_count = 2 float_feature_borders = [ [0.0622565], [0.5], [0.5], ...
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...
#LCM309 class Solution: def maxProfit_LinearSpace(self, prices: List[int]) -> int: # LINEAR SPACE, LINEAR TIME # initialise the arrays for buy and sell to be used for bottom up DP n = len(prices) if n<2: return 0 buy, sell = [0]*n, [0]*n buy[0], sell[0] =...
# # PySNMP MIB module ERI-DNX-NEST-SYS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ERI-DNX-NEST-SYS-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:05:58 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (defau...
# TODO: add all classes and use in _mac.py and _windows.py class Apps: def keys(self): raise NotImplementedError() def add(self, spec=None, add_book=None, xl=None, visible=None): raise NotImplementedError() def __iter__(self): raise NotImplementedError() def __len__(self): ...
# -*- coding: utf-8 -*- SSH_CONFIG_TMP_DIR = "ssh@tmp" SSH_AUTH_BUILD_DIR = "ssh-builder@tmp" SSH_AUTH_FILE_NAME = ".ssh/authorized_keys" LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' PROGRAM = "ssh-manager"
s = input() before = 0 cnt_0 = 0 cnt_1 = 0 for idx in range(1, len(s)): if s[before] != s[idx] and s[before] == '0': cnt_0 += 1 before = idx elif s[before] != s[idx] and s[before] == '1': cnt_1 += 1 before = idx if s[len(s)-1] == '0': cnt_0 += 1 else: cnt_1 += 1 if c...
#OAM: 2 16-bit addresses # 8 bit spriteref # 10 bit x pos # 10 bit y pos # 1 bit x-flip # 1 bit y-flip # 1 bit priority # 1 bit enable OAM = [ { "spriteref":1, "x_pos":13, "y_pos":2, "x_flip":0, "y_flip":0, "priority":0, "enable":1 },...
""" 在终端中输入一个疫情确诊人数再录入一个治愈人数,打印治愈比例 格式:治愈比例为xx% 效果: 请输入确诊人数:500 请输入治愈人数:495 治愈比例为99.0% """ diagnose = int(input("请输入确诊人数:")) cure = int(input("请输入治愈人数:")) proportion = cure / diagnose * 100 print("治愈比例为" + str(proportion) + "%")
print(" Using print command..") # task /title print ("These are how many animals I have:") # print string("...") print("Cows", 15+30/6) # print ("string"+sum) print("Sheep",100-30*3%4) print("Now I will count my plants:") print(3+2+1-5+4%2...
def aumentar(v): val = v * (10/100) + v return val def diminuir(v): val = v - v * (10/100) return val def dobro(v): val = v * 2 return val def metade(v): val = v / 2 return val
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. TYPECHECK_ERROR = 102 class AIException(Exception): pass class AIRecoverableException(AIException): pass class AIProcessExcept...
#!/usr/bin/python #coding=utf-8 ''' @author: sheng @license: ''' SPELL=u'fēngmén' CN=u'风门' NAME=u'fengmen12' CHANNEL='bladder' CHANNEL_FULLNAME='BladderChannelofFoot-Taiyang' SEQ='BL12' if __name__ == '__main__': pass
templates_path = ["_templates"] source_suffix = [".rst", ".md"] master_doc = "index" project = "TileDB-CF-Py" copyright = "2021, TileDB, Inc" author = "TileDB, Inc" release = "0.5.3" version = "0.5.3" extensions = [ "sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.napoleon", "sphinx_autodoc_t...