content
stringlengths
7
1.05M
class Solution: def twoSum(self, numbers: List[int], target: int) -> List[int]: if len(numbers) <= 1: return [None, None] idx2 = len(numbers)-1 idx1 = 0 while idx1 < idx2: if numbers[idx1] + numbers[idx2] == target: return [id...
class SumUpException(Exception): pass class SumUpNoAccessCode(SumUpException): pass class SumUpAccessCodeExpired(SumUpException): pass
# flake8: noqa test_train_config = {"training_parameters": {"EPOCHS": 50}} test_model_config = {"model_parameters": {"model_save_path": "modeloutput1"}} test_test_data = { "text": "what Homeowners Warranty Program means,what it applies to, what is its purpose?" } test_entities = [ {"text": "homeowners warra...
# -*- coding: utf-8 -*- """Modulo helpers.url""" def split_query_string(items): """dividir un query string""" params = {'filter': {}, 'fields': [], 'pagination': {}, 'sort': {}, 'filter_in': {}} for key, value in items: sub_keys = key.split('.') if 'fields' in sub_keys: params['...
def entrance(): '''This is the initial room the player will begin their adventure.''' pass def orange_rm_1(): '''Todo: red key(hidden in desk drawer) health(desk top) desk rat (24% damage) red door ''' pass def red_rm_2(): '''locked entrance- requires red key to do: ...
def main(request, response): headers = [("Content-Type", "text/javascript")] milk = request.cookies.first("milk", None) if milk is None: return headers, "var included = false;" elif milk.value == "yes": return headers, "var included = true;" return headers, "var included = false;"
""" Tema: Algoritmo de aproximacion. Curso: Pensamiento computacional. Plataforma: Platzi. Profesor: David Aroesti. Alumno: @edinsonrequena. """ objetivo = int(input('Escoge un numero: ')) epsilon = 0.0001 paso = epsilon**2 respuesta = 0.0 while abs(respuesta**2 - objetivo) >= epsilon and respuesta <= objetivo: ...
#!/usr/bin/python3.8 def nics_menu(): FILENAME = "nics.yaml" SWITCHES = "-n/--nics" DESCRIPTION = "YAML file that contains the configuration for the interfaces to use" REQUIRED = "always" TEMPLATE = """nics: # number of nics needs to equal to 2 """ NIC_TEMPLATE = """ - name: "{}" # name of t...
"""Amazon Product Advertising API wrapper for Python""" __version__ = '3.2.0' __author__ = 'Sergio Abad'
""" My first Python script - this is a multiline comment """ # My second comment ''' This is also a multiline comment ''' statement = 0 if statement !=False: print(4) counter = 1000 count = 0 sum = 0 while count < counter: if count%3 ==0: sum = sum+count elif count%5 ==0: sum = sum+cou...
for i in range(int(input())): H, W ,N = map(int,input().split()) temp = N tmp = 1 #층 if N%H == 0: temp = H else: temp = N%H #호수 if N/H > int(N/H): tmp = int(N/H)+1 else: tmp = int(N/H) if tmp < 10: print(temp,"0",tmp,sep="") els...
localizacao = {'Brasil': 'América', 'Portugal': 'Europa', 'Espanha': 'Europa'} continente_brasil = localizacao['Brasil'] print(continente_brasil)
CORRECT_PIN = "1234" MAX_TRIES = 3 tries_left = MAX_TRIES pin = input(f"Insert your pni ({tries_left} tries left): ") while tries_left > 1 and pin != CORRECT_PIN: tries_left -= 1 print("Your PIN is incorrect.") pin = input(f"Insert your pni ({tries_left} tries left): ") if pin == CORRECT_PIN: print("...
# # Solution to Project Euler problem 73 # Copyright (c) Project Nayuki. All rights reserved. # # https://www.nayuki.io/page/project-euler-solutions # https://github.com/nayuki/Project-Euler-solutions # # The Stern-Brocot tree is an infinite binary search tree of all positive rational numbers, # where each number ...
""" Contains the Artist class """ __all__ = [ 'Artist', ] class Artist(object): """ Represents an artist """ def __init__(self): """ Initiate properties """ self.identifier = 0 self.name = '' self.other_names = '' self.group_name = '' ...
class BaseSiteCheckerException(Exception): pass class ErrorStopMsgLimit(BaseSiteCheckerException): pass
def get_safe_balanced_split(target, train_ratio=0.8, get_test_indices=True, shuffle=False, seed=None): classes, counts = np.unique(target, return_counts=True) num_per_class = float(len(target))*float(train_ratio)/float(len(classes)) if num_per_class > np.min(counts): print("Insufficient data to produce a bala...
print("Welcome to the Multiplication/Exponent Table App") print() name = input("Hello, What is your name: ") number = float(input("What number would you like to work with: ")) name = name.strip() print("Multiplication Table For {}".format(number)) print() print("\t\t1.0 * {} = {:.2f}".format(number, number*1.0)) print...
# Live preview Markdown and reStructuredText files as HTML in a web browser. # # Author: Peter Odding <peter@peterodding.com> # Last Change: April 12, 2018 # URL: https://github.com/xolox/python-preview-markup __version__ = '0.3.3'
class DockablePaneState(object,IDisposable): """ Describes where a dockable pane window should appear in the Revit user interface. DockablePaneState(other: DockablePaneState) DockablePaneState() """ def Dispose(self): """ Dispose(self: DockablePaneState) """ pass def ReleaseUnmanagedResources(...
class Solution: """ @param n: an integer @return: if n is a power of two """ def isPowerOfTwo(self, n): # Write your code here while n>1: n=n/2 if n ==1: return True else: return False
# # These methods are working on multiple processors # that can be located remotely # class Bridges: @staticmethod def create(master=None, workers=None, name=None): raise NotImplementedError @staticmethod def set(master=None, workers=None, name=None): raise NotImplementedError @s...
#Crie um programa que leia dois números e mostre a soma entre eles. while True: try: sValue1 = input('Digite o primeiro número:') sValue2 = input('Digite o segundo número:') fValue1 = float(sValue1) fValue2 = float(sValue2) except: print('Digite apenas valores numéricos!...
"""Simple touch utility.""" def touch(filename: str) -> None: """Mimics the "touch filename" utility. :param filename: filename to touch """ with open(filename, "a"): pass
for index in range(1,101): # if index % 15 == 0: # print("fifteen") if index % 3 == 0 and index % 5 == 0 : print("fifteen") elif index % 3 == 0: print("three") elif index % 5 == 0: print("five") else: print(index)
class Solution: def rob(self, nums): if not nums: return 0 values = [0] * len(nums) for i in range(len(nums)): if i == 0: values[i] = max(values[i], nums[i]) elif i == 1: values[i] = max(values[i-1], nums[i]) els...
# Copyright 2018 The TensorFlow 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
MASTER_PROCESS_RANK = 0 # Only meaningful if webscraper is run with multiple processes. Here we use rank = 0 for master process; however we can set it to any value in [0, nprocs-1]. READING_RATIO_FOR_INPUT_CSVs = 1 # It represents how much of the input files (in csv format for now) we should process....
# # @lc app=leetcode.cn id=1689 lang=python3 # # [1689] detect-pattern-of-length-m-repeated-k-or-more-times # None # @lc code=end
print("Raadsel 1:", "\n Wanneer leefde de oudste persoon ter wereld?") guess = input() #"TUSSEN GEBOORTE en dood" # input () guess_words = [] for g in guess.split(): guess_words.append(g.lower()) answer_words = ["tussen", "geboorte", "dood"] incorrect = False for word in answer_words: if word not in ...
class SettingsCalibration: """Период калибровки""" first_period = 0 # ПК1 second_period = 1 # ПК2 third_period = 2 # ПК3 periods = { first_period: 1, second_period: 2, third_period: 60, } class SettingsSpaceCycles: """Число циклов космоса""" cos1 = 0 # КОС1...
def wczytaj(): """ Wczytanie danych z pliku do tabeli returns list of strings """ tab = [] with open("liczby.txt", "r") as f: for line in f: #print(line.strip()) tab.append(line.strip()) #print(tab) ...
# Problem code def countAndSay(n): if n == 1: return "1" current = "1" for i in range(2, n + 1): current = helper(current) return current def helper(current): group_count = 1 group_member = current[0] result = "" for i in range(1, len(current)): if current[i] =...
""" This package contains serializers. Purpose of serializer class is to convert hwt representations of designed architecture to target language or form (VHDL/Verilog/SystemC...). """
# A classroom consists of N students, whose friendships can be represented in # an adjacency list. For example, the following descibes a situation where 0 # is friends with 1 and 2, 3 is friends with 6, and so on. # {0: [1, 2], # 1: [0, 5], # 2: [0], # 3: [6], # 4: [], # 5: [1], # 6: [3]} # Each stu...
class Solution(object): def longestCommonSubsequence(self, text1, text2): if not text1 or not text2: return 0 m = len(text1) n = len(text2) dp = [[0]*(n+1) for _ in range(m+1)] for i in range(1,m+1): for j in range(1,n+1): if text1[i-1]...
class Printer(object): def __init__(self, sort_keys=None, order=None, header=None): self.sort_keys = sort_keys self.order = order self.header = header def print(self, d, format='table'): print(self.value(d,format=format)) def value(self, d, format='table'): return ...
# Copyright 2020 BlueCat Networks. All rights reserved. # -*- coding: utf-8 -*- type = 'api' sub_pages = [ { 'name' : 'user_inventory_page', 'title' : u'user_inventory', 'endpoint' : 'user_inventory/user_inventory_endpoint', 'description' : u'user_inventory' }, ]...
""" One way of improving the memory efficiency of the NaiveStack would be to recognise that: [] [1] [1,2] [1,2,3] Holds the same information as: [1, 2, 3] (on the assumption that there have been no pops) So rather than creating a new version for every push and every pop, we could create a new version only on pops...
__all__ = ("Values", ) class Data(object): def __init__( self, plugin_instance=None, meta=None, plugin=None, host=None, type=None, type_instance=None, interval=None, time=None, values=None, ...
age = 6 if age < 1: print("baby") elif age < 3: print("toddler") elif age < 5: print("preschool") elif age < 12: print("gradeschooler") elif age < 19: print("teen") elif age > 20: print("old") else: print("integer error")
def main(): # input H, W = map(int, input().split()) sss = [input() for _ in range(H)] # compute cnt = 0 for h in range(1,H-1): for w in range(1,W-1): if sss[h][w]=='#' and sss[h-1][w]!='#' and sss[h+1][w]!='#' and sss[h][w-1]!='#' and sss[h][w+1]!='#': cnt +...
# -*- coding: utf-8 -*- """ walle-web :copyright: © 2015-2017 walle-web.io :created time: 2018-11-11 19:49:37 :author: wushuiyong@walle-web.io """ class Code(): #: 1xxx 表示用户相关: 登录, 权限 #: 未登录, 大概是永远不会变了 unlogin = 1000 #: 无此权限 not_allow = 1001 #: 尚未开通空间 space_empty = 1002...
class Solution: def getModifiedArray(self, length: int, updates: List[List[int]]) -> List[int]: arr = [0] * (length + 1) for s, e, i in updates: arr[s] += i arr[e+1] -= i for i in range(1, length): arr[i] += arr[i-1] return arr[:-1]
nerdle_len = 8 nerd_num_list = [str(x) for x in range(nerdle_len+2)] nerd_op_list = ['+','-','*','/','=='] nerd_list = nerd_num_list+nerd_op_list
def assert_raises(excClass, callableObj, *args, **kwargs): """ Like unittest.TestCase.assertRaises, but returns the exception. """ try: callableObj(*args, **kwargs) except excClass as e: return e else: if hasattr(excClass,'__name__'): excName = excClass.__name__ e...
''' As is can shift max '1111' -> 15 on one command... So a call like shift(20) would need to be split up... Thinking the user should do this when coding... or could be stdlib fx that does this... If want to do shift(16) in one cycle, can add s4 support (and correspoinding 16muxes) to hardware... revisit as ...
# coding: utf-8 SECRET_KEY = 'foo' EMAIL_BACKEND = 'postmarker.django.EmailBackend' POSTMARK = { 'TOKEN': '<YOUR POSTMARK SERVER TOKEN>' }
def is_prime(num, primes): for prime in primes: if prime == num: return True if not num % prime: return False return True def get_primes(num): limit = (num // 2) + 1 candidates = list() primes = list() for i in range(2, limit): if is_prime(i, pr...
#program to remove two duplicate numbers from a given number of list. def two_unique_nums(nums): return [i for i in nums if nums.count(i)==1] print(two_unique_nums([1,2,3,2,3,4,5])) print(two_unique_nums([1,2,3,2,4,5])) print(two_unique_nums([1,2,3,4,5]))
types = [ { 'name': 'RNAExpression', 'item_type': 'rna-expression', 'schema': { 'title': 'RNAExpression', 'description': 'Schema for RNA-seq expression', 'properties': { 'uuid': { 'title': 'UUID', ...
def square(x): return x * x def launch_missiles(): print('missiles launched') def even_or_odd(n): if n % 2 == 0: print('even') return print('odd')
n = 1 for i in range(1, 10 + 1): print(n) n *= i
#!/usr/bin/env python # coding: utf-8 # # Hill Cipher # Below is the code to implement the Hill Cipher, which is an example of a **polyalphabetic cryptosystem**, that is, it does # not assign a single ciphertext letter to a single plaintext letter, but rather a ciphertext letter may represent more than # one plaint...
file = open('Advent-of-Code-2021\\Day 13\\Day 13 input.txt') points = [] folds = [] for line in file: line = line.strip() if (line.find(',') != -1): pointparse = line.split(',') points.append([int(pointparse[0]),int(pointparse[1])]) elif (line.find('=') != -1): foldparse = line.sp...
dummy1_iface_cfg = { 'INTERFACE': { 'MODULE': 'daq.interface.interface', 'CLASS': 'DummyInterface', }, 'IFCONFIG': { 'LABEL': 'Dummy1', 'ADDRESS': 'DummyAddress', 'SerialNumber': '1234', } } dummycpc_inst_cfg = { 'INSTRUMENT': { 'MODULE': 'daq.instrum...
# @Title: 跳跃游戏 (Jump Game) # @Author: 18015528893 # @Date: 2021-02-22 00:17:58 # @Runtime: 48 ms # @Memory: 16 MB class Solution: def canJump(self, nums: List[int]) -> bool: max_i = 0 last = len(nums) - 1 for i in range(len(nums)): jump = nums[i] if max_i >= i: ...
# -*- coding: utf-8 -*- def main(): n, k = map(int, input().split()) a = list(map(int, input().split())) ans = float('inf') # KeyInsigh: bit全探索 # 1つだけWAが取れなかった # See: # https://atcoder.jp/contests/s8pc-4/submissions/2122030 if n == 1: print(0) exit() ...
print(dir(str)) nome = 'Flavio' print(nome) print(nome[:3]) texto = 'marca d\' agua' print(texto) texto = "marca d' agua" print(texto) texto = ''' texto ... texto ''' print(texto) texto = ' texto\n\t ...texto' print(texto) print(str.__add__('a', 'b')) nome = 'Flavio Garcia Fernandes' print(nome)...
with open('in') as f: data = list(map(lambda l: list(l.strip().replace(' ', '')), f.readlines())) def evaluate(e): value = None operation = None i = 0 while i < len(e): c = e[i] if c in '+*': operation = c elif c in '0123456789': c = int(c) ...
# just keep this as-is def not_an_activity(): print("boom")
label_data = open("label", encoding='utf-8').readlines() label_data = [x.strip() for x in label_data] print(len(label_data)) label_kinds = set(label_data) print(label_kinds)
class NotFoundError(Exception): """ Thrown during :meth:`get` when the requested object could not be found. """ pass class ValidationError(Exception): """ Thrown by :class:`Field` subclasses when setting attributes that are invalid. """ pass
def tupler(atuple): print(f"{atuple=}") return (1, 2, 3) print(f"{type(tupler((10, 11)))=}")
# 代理模式 # 虚拟代理 class LazyProperty: def __init__(self, method): self.method = method self.method_name = method.__name__ def __get__(self, instance, owner): if not instance: return None value = self.method(instance) setattr(instance, self.method_name, value) ...
n1 = int (input()) s1 = set(map(int,input().split())) n2 = int (input()) s2 = set(map(int,input().split())) print(len(s1.intersection(s2)))
raio = int(input()) pi = 3.14159 volume = float(4.0 * pi * (raio* raio * raio) / 3) print("VOLUME = %0.3f" %volume)
#!/usr/bin/env python # encoding: utf-8 GRADES_FILENAME = 'grades.csv' GRADING_SLASH_DELIMINATOR = '/' SUBMISSIONS_FILENAME = 'Submissions' GRADING_URL_EXTENSION = '&action=grading' SUBMISSION_LISTING_DELIMINATOR = '-_submission_-' GRADING_BLANK_GRADE = '-' GRADING_HEADER_NAME = 'Name' GRADING_HEADER_EMAIL = 'Email' ...
# display menu, list ciphers class Menu: def __init__(self, ciphers): self.ciphers = ciphers self.modes = ["encrypt", "decrypt"] def get_mode(self): print("Select one of the methods (enter number)") for idx, mode in enumerate(self.modes)...
#print("for loop") #word = ["this", "is","roshan"] # for w in word: print(w, len(w)) #give range of each word for w in range(len(word)): print(w, word[w]) #get odd or even """ for x in range(0,5): x+=1 #print(x) if x % 2 == 0: print(f"{x}::Even No") else: print(f"{x}::Odd No") ...
# Time: O(n) # Space: O(n) class UnionFind(object): def __init__(self, n): self.set = range(n) def find_set(self, x): if self.set[x] != x: self.set[x] = self.find_set(self.set[x]) # path compression. return self.set[x] def union_set(self, x, y): ...
# IP and port to bind to. bind = ['127.0.0.1:4000'] # Maximum number of pending connections. backlog = 2048 # Number of worker processes to handle connections. workers = 2 # Fork main process to background. daemon = True # PID file to write to. pidfile = "web.gunicorn.pid" # Allow connections from any frontend pro...
# Faça um programa que leia o nome completo de uma pessoa, mostrando em seguida o primeiro e o último nome separadamente. print('-' * 100) print('{: ^100}'.format('EXERCÍCIO 027 - PRIMEIRO E ÚLTIMO NOME DE UMA PESSOA')) print('-' * 100) nome = str(input('Digite seu nome completo: ')).title().strip().split() print(f'...
lista = [[],[]] for i in range(7): num = int(input(f'Digite o {i+1}o. valor: ')) if num%2 == 0: lista[0].append(num) else: lista[1].append(num) print(f'Os valores pares digitados foram: {sorted(lista[0])}') print(f'Os valores ímpares digitados foram: {sorted(lista[1])}')
i = 0 while(True): if i+1<5: i = i + 1 continue print(i+1, end=" ") if(i==50): break #stop the loop i = i+ 1
#https://leetcode.com/problems/min-stack/ class MinStack(object): def __init__(self): self.stack = [] def push(self, x): self.stack.append((x, min(x, self.getMin()))) def pop(self): if len(self.stack)==0: return None return self.stack.pop()[0] ...
# -*- coding: utf-8 -*- """ flybirds common error """ class FlybirdNotFoundException(Exception): """ not find flybirds """ def __init__(self, message, select_dic, error=None): message = f"selectors={str(select_dic)} {message}" if error is not None: message = f"{message} in...
class RaggedContiguous: """Mixin class for an underlying compressed ragged array. .. versionadded:: (cfdm) 1.7.0 """ def get_count(self, default=ValueError()): """Return the count variable for a compressed array. .. versionadded:: (cfdm) 1.7.0 :Parameters: defau...
## This module deals with code regarding handling the double ## underscore separated keys def dunderkey(*args): """Produces a nested key from multiple args separated by double underscore >>> dunderkey('a', 'b', 'c') >>> 'a__b__c' :param *args : *String :rtype : String """ ...
def insert_newlines(string, every=64): return '\n'.join(string[i:i+every] for i in range(0, len(string), every)) for __ in range(int(input())): n = int(input()) o = "O" x = "X" a = ["X" for i in range(64)] for i in range(n): a[i] = "." a[0]=o print(insert_newlines("".join(a),8))...
## Set Configs print('Set configs..') sns.set() pd.options.display.max_columns = None RANDOM_SEED = 42 fig_path = os.path.join(os.getcwd(), 'figs') model_path = os.path.join(os.getcwd(), 'models') model_bib_path = os.path.join(model_path,'model_bib') data_path = os.path.join(os.getcwd(), 'data') ## read the data pri...
a = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] # dumb way # for i in range(0,len(a),1): # if a[i]%2 == 0: # print(str(a[i]),end=" ") b = [i for i in a if i % 2 == 0] print(b)
''' Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just two one's added together. 12 is writte...
# https://www.codewars.com/kata/55a243393fb3e87021000198/train/python # My solution def remember(text): counter = {} result = [] for ch in text: counter[ch] = counter.get(ch, 0) + 1 if counter[ch] == 2: result.append(ch) return result # ... def remember(str_): ...
directory_map = { "abilene": "directed-abilene-zhang-5min-over-6months-ALL", "geant": "directed-geant-uhlig-15min-over-4months-ALL", "germany50": "directed-germany50-DFN-aggregated-1day-over-1month", }
class Math1(): def __init__(self): self.my_num1 = 10 self.my_num2 = 20 def addition(self): return self.my_num1 + self.my_num2 def subtraction(self): return self.my_num1 - self.my_num2 class Math_Plus(Math1): def __init__(self, my_num1=40, my_num2=90): self...
# single source of truth for package version, # see https://packaging.python.org/en/latest/single_source_version/ __version__ = "0.6.0" # app name to send as part of SDK requests app_name = "DLHub CLI v{}".format(__version__)
# coding: utf8 # try something like def index(): return plugin_flatpage() def rfp(): return plugin_flatpage()
# Exercício Python 69: Crie um programa que leia a idade e o sexo de várias pessoas. A cada pessoa cadastrada, o programa deverá perguntar se o usuário quer ou não continuar. No final, mostre: A) quantas pessoas tem mais de 18 anos. B) quantos homens foram cadastrados. C) quantas mulheres tem menos de 20 anos. i = m =...
""" MicroPython driver for MLX90615 IR temperature I2C sensor : https://github.com/rcolistete/MicroPython_MLX90615_driver Version with simple read functions : 0.2.1 @ 2020/05/05 Author: Roberto Colistete Jr. (roberto.colistete at gmail.com) License: MIT License (https://opensource.org/licenses/MIT) """ __version__ = '...
# -*- coding: utf-8 -*- """Contains version information""" __version__ = "0.7.9"
''' PyTorch implementation of the RetinaNet object detector: Lin, Tsung-Yi, et al. "Focal loss for dense object detection." Proceedings of the IEEE international conference on computer vision. 2017. Basic implementation forked and adapted from: https://github.com/kuangliu/pytorch-retinanet 2019 Be...
#Faça um programa que leia três números inteiros e colocá-los em ordem crescente. #Sugestão: Sejam 3 números A, B e C. A ideia principal é: # – armazenar em A o menor valor # – armazenar em B o valor intermediário # – armazenar em C o maior valor a = int(input("Digite um número para a: ")) b = int(input("Digite um núm...
#import gui.gui as gui # Python3 program to find number # of bins required using # First Fit algorithm. # Returns number of bins required # using first fit # online algorithm def firstFit(weight, n, c): # Initialize result (Count of bins) res = 0 # Create an array to store # remaining space in bins # there...
# mapping for AWS IAM user_name to slack ID accross all AWS accounts # # Fill in "<aws_IAM_user_id>:<slack_id>" here. Seperate each entry by a comma, and leave the last one without a comma # Example: # mapping = { # "IAM_user_id1":"slack_id1", # "IAM_user_id2":"slack_id2", # "IAM_user_id3":"slack_id...
vents = """964,133 -> 596,133 920,215 -> 920,976 123,528 -> 123,661 613,13 -> 407,13 373,876 -> 424,876 616,326 -> 120,326 486,335 -> 539,388 104,947 -> 54,947 319,241 -> 282,204 453,175 -> 453,438 485,187 -> 915,617 863,605 -> 603,605 870,524 -> 342,524 967,395 -> 634,62 405,181 -> 807,181 961,363 -> 419,905 89,586 ->...
# Bot's version number __version__ = "0.1.0" # Authorized guild GUILD_ID = 952941520867196958
#Rep of loops numbers = [2, 3, 4, 45] l = len(numbers) for i in range(l): print(numbers[i]) # each iteration the i takes on a different #value according to len of numbers (4) for i in range(8): print(i) # prints numbers 0 through 7 for el in numbers: print(el) # using a loop to change elements within ...
""" cheesyutils - A number of utility packages and functions """ __title__ = "cheesyutils" __author__ = "CheesyGamer77" __copyright__ = "Copyright 2021-present CheesyGamer77" __version__ = "0.0.30"
def append_text(new_text): ''' Write the code instruction to be exported later on Args. new_text (str): the text that will be appended to the base string ''' global code_base_text code_base_text = code_base_text + new_text