content
stringlengths
7
1.05M
# -*- coding: utf-8 -*- # 文章的状态 STATUS_CHOICES = ( ('d', '延迟发布'), # delay ('p', '发布'), # publish )
filename = "myFile1.py" with open(filename, "r") as f: for line in f: print(f)
""" domonic.constants ==================================== """ namespaces = {'xml': 'http://www.w3.org/XML/1998/namespace', 'svg': 'http://www.w3.org/2000/svg', 'xlink': 'http://www.w3.org/1999/xlink', 'xmlns': 'http://www.w3.org/2000/xmlns/', 'xm': 'http://www.w3.org/2001/xml-events', 'xh': 'ht...
m = 35.0 / 8.0 n = int(35/8) print(m) print(n)
class Dealer: def __init__(self): self.__hand = None def select_action(self): if self.hand_total() < 17: return 1 else: return 0 def give_card(self, card): self.__hand.add_card(card) def revealed_card(self): cards = self.__hand.cards() return cards[0] def is_busted(...
# https://cses.fi/problemset/task/1083 d = [False for _ in range(int(input()))] for i in input().split(' '): d[int(i) - 1] = True for i, b in enumerate(d): if not b: print(i + 1) exit()
#crie um programa que leia um valor em #metros e exiba convertido em centímetros #e em milímetros m=float(input('Digite uma distância em metros: ')) cm=m*100 mm=m*1000 print ('A distância de {} metros, corresponde a {:.0f} cm e {:.0f} mm '.format (m,cm,mm))
{ "targets": [ { "target_name": "lib/daemon", "sources": [ "src/daemon.cc" ] } ] }
class CommandTools: @staticmethod def get_token(): """ Simple helper that will return the token stored in the text file. :return: Your Robinhood API token """ robinhood_token_file = open('robinhood_token.txt') current_token = robinhood_token_file.read() return...
def main(): st = input("") print(st[0]) print(end="") main()
# 题目描述: # M 队和 T 队将要进行射箭比赛,M 队的队长是小美,T 队的队长是小团。 # 这场射箭比赛的规则是,每个队员都可以选择一个距离进行射击, # 若射中靶心且距离小于等于 d 则团队得 1 分,若射中靶心且距离大于 d 则团队得 2 分。 # 小团对敌我情况了如指掌,他知道接下来 M 队将会有 n 名队员射中靶心, # 且知道这些队员选择的射箭距离, # 以及自己所带领的 T 队会有 m 名队员射中靶心和他们选择的射箭距离。 # 假定 d 的值可以由小团确定(d 的范围恒为 [1,1000]), # 小团想知道自己的队伍最多能赢小美的队伍多少分(T 队得分减去 M 队得分的最大值)。 # 输入描述 # 第一行两...
# This program demonstrates how to use the remove # method to remove an item from a list. def main(): # Create a list with some items. food = ['Pizza', 'Burgers', 'Chips'] # Display the list. print('Here are the items in the food list:') print(food) # Get the item to change. i...
#coding:utf-8 # log into your home router and create a port forward to point to this server # use the external port number 911 and direct it to port 80 on this machine #leave these alone unles you absolutely have to touch them PIR_PIN_1 = 23 # Right hand PIR - outside PIR_PIN_2 = 24 # Left hand PIR - inside - send...
class TeamNotFound(Exception): """Raise when the team is not found in the database""" class NoMatchData(Exception): """Raise when data for match cant be created"""
def computepay(h, r): print("In computepay") if h>40: pay = 40 * r + (h - 40) * 1.5 * r else: pay = h * r return pay hrs = input("Enter Hours:") h = float(hrs) rate = input("Enter Rate:") r = float(rate) pay = computepay(h,r) print(pay)
"""Scheduling errors.""" class AssignmentError(Exception): """Raised for errors when generating assignments.""" def __init__(self, message: str): self.message = message
''' MIT License Name cs225sp20_env Python Package URL https://github.com/Xiwei-Wang/cs225sp20_env Version 1.0 Creation Date 26 April 2020 Copyright(c) 2020 Instructors, TAs and Some Students of UIUC CS 225 SP20 ZJUI Course Instructorts: Prof. Dr. Klaus-Dieter Schewe TAs: Tingou Liang, Run Zhang, Enyi Jiang, Xiang Li...
def merge(list0,list1): result = [] while len(list1) and len(list0): if list0[0]<list1[0]: result.append(list0.pop(0)) else: result.append(list1.pop(0)) result.extend(list0) result.extend(list1) return result def mergesort(item): if len(item)<=1: ...
# Link - https://leetcode.com/problems/unique-morse-code-words/ ''' Runtime: 28 ms, faster than 95.58% of Python3 online submissions for Unique Morse Code Words. Memory Usage: 13.6 MB, less than 99.77% of Python3 online submissions for Unique Morse Code Words. ''' class Solution: def uniqueMorseRepresentations(se...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # services - Waqas Bhatti (wbhatti@astro.princeton.edu) - Oct 2017 # License: MIT. See the LICENSE file for more details. '''This contains various modules to query online data services. These are not exhaustive and are meant to support other astrobase modules. - :py:mod:`...
vacation_cost = float(input()) available_money = float(input()) spending_counter = 0 days_passed = 0 saved = True while available_money < vacation_cost: #spend or save action_type = input() current_sum = float(input()) days_passed += 1 if action_type == 'spend': spending_counter += 1 ...
NOT_FOUND = -1 class Search(object): def __init__(self, sample): self.sample = sample
def convHatoAlq(n): alq = n / 2.42 return alq def convHatoM2(n): m2 = n * 10000 return m2 def convAlqtoHa(n): ha = n * 2.42 return ha def convAlqtoM2(n): m2 = n * 24200 return m2 def convM2toHa(n): ha = n / 10000 return ha def convM2toAlq(n): alq = n / 24200 return alq def M2Format(n): res = f'...
__all__ = 'MissingContextVariable', class MissingContextVariable(KeyError): pass
# [카카오] 기둥과 보 설치 def check(board, y, x, a): if a == 0: if x == 0: return True if y - 1 >= 0 and board[y - 1][x][1] or board[y][x][1]: return True if x - 1 >= 0 and board[y][x - 1][0]: return True else: if x - 1 >= 0 and board[y][x - 1][0]: ...
# with-Statement def setup(): size(400, 400) background(255) def draw(): fill(color(255, 153, 0)) ellipse(100, 100, 50, 50) with pushStyle(): fill(color(255, 51, 51)) strokeWeight(5) ellipse(200, 200, 50, 50) ellipse(300, 300, 50, 50)
# Develop a program that calculates the sum between all the odd numbers # that are multiples of three and are in the range of 1 to 500. sum = 0 for i in range(1,501): if (i % 2 != 0 ) and (i % 3 == 0): sum += i print(sum)
# https://www.codewars.com/kata/526571aae218b8ee490006f4/ ''' Instructions : Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number. You can guarantee that input is non-negative. Example: The binary representation of 1234 is ...
# this is a part of binary search tree class. # The right, left and parent functions can be found in the binary search tree implementation. def TreeSearch(T,p,k): if k == p.key(): return p # successful search elif k < p.key() and T.left(p) is not None: return Tree...
def isNode(data): if type(data) == Node: return True else: return False class Node: def __init__(self, data=None) -> None: self.data = data self.previous = None self.next = None def __str__(self) -> str: if self.previous == None and self.next == None: ...
"""test too short name """ __revision__ = 1 A = None def a(): """yo""" pass
N = int(input()) ans = 1e12 # 約数を求める。N**.5までで十分 for n in range(1, int(N ** 0.5) + 1): if N % n == 0: ans = min(ans, n + N // n - 2) print(ans)
# -*- coding: utf-8 -*- ''' XlPy/Peptide_Database/sequencing ________________________________ Contains data for generating theoretical mass tables for searching peptide sequencing ions. :copyright: (c) 2015 The Regents of the University of California. :license: GNU GPL, see licenses/GNU GPLv3....
# weight = [3, 5, 7] # n = len(weight) # a = 6 # # for i in range(n): # print(weight) # if weight[i] < a: # weight.remove(weight[i]) # # print(weight) # arr8 = [4, 3, 4, 4, 4, 2] # # print('start') # for i in range(len(arr8) - 1): # print(arr8[:i+1], arr8[i+1:], " - ", i) def solution(arr): s...
"""Demo assignment with separate test files.""" def square(x): """Return x squared.""" return x * x def double(x): """Return x doubled.""" return x # Incorrect
class GeometryBase(CommonObject,IDisposable,ISerializable): # no doc def ComponentIndex(self): """ ComponentIndex(self: GeometryBase) -> ComponentIndex """ pass def ConstructConstObject(self,*args): """ ConstructConstObject(self: CommonObject,parentObject: object,subobject_index: int) """ pass def D...
def sort(elements): while True: swapped = False for i in range(len(elements)-1): if elements[i] > elements[i+1]: # swap temp = elements[i] elements[i] = elements[i+1] elements[i+1] = temp swapped = True ...
# D. Заботливая мама # ID успешной посылки 65663041 class Node: def __init__(self, value, next_item=None): self.value = value self.next_item = next_item def solution(node, elem): count = 0 while node.value != elem: if node.value != elem and node.next_item is None: co...
PORT = 8000 URL = "http://localhost:{}".format(PORT) SITE_LOCATION = 'test_site/index.html' csv_log_single_site_init = [(False, False, True), (False, False, False)] # TODO: Add logs and csv tests # (True, False, True), (False, False, True), (True, True, True)] variations = [{ 'element': 'id', 'element_id':...
# # PySNMP MIB module ELTEX-MES-HWENVIROMENT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ELTEX-MES-HWENVIROMENT-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:01:22 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version ...
class Solution: def levelOrder(self, root: 'Node') -> List[List[int]]: if root==None: return [] list_trans=[] queue=[root] while queue: child=[] nodes=[] for node in queue: child.append(node.val) ...
def contador(* núm): tam = len(núm) print(f'Recebí os valores {núm} e são ao todo {tam} números') contador(2, 1, 7) contador(8, 0) contador(4, 4, 7, 6, 2)
MAP_SIZE = 24 TILE_SIZE = 16 ENTITY_ID = 1 ARROW_SPEED = 9999 ENTITYMAP = {} PLAYER_ENTITIES = [] TILEMAP = {} GAMEINFO = {} # playerid, gameinstance # REMOVE = []
# coding: utf-8 """ author: Olivier Chabrol updated by: Louai KB """ class Node: """ Node of a list """ def __init__(self, data): """constructor Args: data (float): the data of the node """ self.data = data self.next = None def __str__(self): ...
''' * Tuplas * Repositório: Lógica de Programação e Algoritmos em Python * GitHub: @michelelozada ''' # 1 - Declaração inicial livro = ( 'O Hobbit', 'The Hobbit', 'J.R.R. Tolkien', 'Ficção', 'HarperCollins', '5a.edição', 2019, '336 p.', ) # 2 - Retorno do tipo da estrutura de...
# 1) O que uma pessoa Tem? Quais as caracteristicas? ''' Atributos ---- variaveis globais ou unicas da class nome | idade | telefone | sexo ''' # 2) O que uma pessoa faz? ''' metodos (função/procedimento) respira | dorme | corre | bebe | come | multiplica ''' # 3) Como a pessoa está agora? ''' (Atributos de estado...
obstacleSet = set([(10, 2, 4, 5), (3, 4), (4, 4), (5, 4)]) print((2, 4) in obstacleSet) print(obstacleSet) print(set([(1, 2), (3, 4)]))
def quickSort(array, head, tail): # an implementation of quicksort algorithm if head >= tail: return else: pivot = partition(array, head, tail) quickSort(array, head, pivot) quickSort(array, pivot+1, tail) def partition(array, h...
passports = [] x=0 vCount=0 keys = {"byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"} with open("Day4\\test2.txt", "r") as data: passports = [i.replace('\n', ' ').split() for i in data.read().split('\n\n')] for i in passports: print(i) ...
''' Vanir OS exception hierarchy ''' class VanirException(Exception): '''Exception that can be shown to the user''' class VanirVMNotFoundError(VanirException, KeyError): '''Domain cannot be found in the system''' def __init__(self, vmname): super(VanirVMNotFoundError, self).__init__( ...
# Média de notas por inicial do nome # Existe uma suspeita do laboratório SpuriousCorrelations de que a letra inicial do nome de um aluno influencia em seu desempenho acadêmico. Faça uma função que recebe um dicionário de notas cujas chaves são os nomes dos alunos. A função deve devolver um novo dicionário com as média...
def entrada(): n,l = map(int,input().split()) return n,l def perimetro(n,lado): return n*lado def main(): n,l=entrada() print(perimetro(n,l)) main()
# # PySNMP MIB module DES-1228p-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DES-1228P-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:23:55 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 201...
BOT_PREFIX = '[bot] ' BOT_SUFFIX = '\n' class BotReply: def send_reply(self, dest, tg_socket): raise NotImplementedError
products = [ { 'id': 1, 'name': 'Apple', 'price': 200, 'quantity': 20 }, { 'id': 2, 'name': 'Milk', 'price': 20, 'quantity': 100 }, { 'id': 3, 'name': 'Rice', 'price': 500, 'quantity': 20 }, { 'id': 4, 'name': 'Pepsi', ...
class Node(object): def __init__(self, data=None, next_node=None): self.data = data self.next = next_node
TITLE = "Hex and Xor" STATEMENT_TEMPLATE = ''' Дан код, шифрующий флаг, и результат его работы. Получите флаг. `flag = 'some string' key = '' # one byte key was removed for security reasons output = "" for character in flag: temp = ord(character) ^ ord(key) output += (hex(temp))[2:] + ' ' key =...
""" CSCI-603: Trees (week 10) Author: Sean Strout @ RIT CS This is an implementation of a binary tree node. """ class BTNode: """ A binary tree node contains: :slot val: A user defined value :slot left: A left child (BTNode or None) :slot right: A right child (BTNode or None) """ __slo...
def load(file = "data.txt"): data = [] for line in open(file): data.append(line) return data
""" [2017-05-26] Challenge #316 [Hard] Longest Uncrossed Knight's Path https://www.reddit.com/r/dailyprogrammer/comments/6dgiig/20170526_challenge_316_hard_longest_uncrossed/ # Description The longest uncrossed (or nonintersecting) knight's path is a mathematical problem involving a knight on the standard 8×8 chessbo...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def diameterOfBinaryTree(self, root: TreeNode) -> int: if root is None: return 0 diameter = 0 def ge...
def listToString(s): """ Description: Need to build function because argparse function returns list, not string. Called from main. :param s: argparse output :return: string of url """ # initialize an empty string url_string = "" # traverse in the string for ele in s: url_str...
def prefix_prefix(w, m): def naive_scan(i, j): r = 0 while i + r <= m and j + r <= m and w[i + r] == w[j + r]: r += 1 return r PREF, s = [-1] * 2 + [0] * (m - 1), 1 for i in range(2, m + 1): # niezmiennik: s jest takie, ze s + PREF[s] - 1 jest maksymalne i PREF[s] > 0 k = i - s + 1 s...
class lz78(object): @staticmethod def name(): return 'LZ78' @staticmethod def compress(data, *args, **kwargs): '''LZ78 compression ''' d, word = {0: ''}, 0 dyn_d = ( lambda d, key: d.get(key) or d.__setitem__(key, len(d)) or 0 ) ret...
def insideBoard(board, x, y): """detecta si la ficha que quieres poner esta dentro de los limites del tablero Args: board (list): lista que contiene el tablero x (int): posicion x en la que quieres poner en el tablero y (int): posicion y en la que quieres poner en el tablero Return...
longname = {'S': 'Susceptible', 'E': 'Exposed', 'I': 'Infected (symptomatic)', 'A': 'Asymptomatically Infected', 'R': 'Recovered', 'H': 'Hospitalised', 'C': 'Critical', 'D': 'Deaths', 'O': 'Offsite', 'Q'...
l = [0]*101 for i in range(1, 10): for j in range(1, 10): l[i*j] = 1 n = int(input()) if l[n] == 1: print("Yes") else: print("No")
""" @date: 2021/7/5 @description: """
class RomanNumerals: def to_roman(val): result = '' symbols = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'] nums = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1] nums_len = len(nums) i = 0 while i < nums_len: if nums[i]...
''' Write an algorithm Sums-One-Two-Three(n) that takes an integer n and, in time O(n), returns the number of possible ways to write n as a sum of 1, 2, and 3. For example, Sums-One-Two-Three(4) must return 7 because there are 7 ways to write 4 as a sum of ones, twos, and threes (1+1+1+1, 1+1+2, 1+2+1, 2+1+1, 2+2, 1+3,...
# Write your solution for 1.3 here! a=0 i=1 while a < 10000: a+=i i+=1 print(i) ##### a=0 i=2 while a<10000: a+=i i+=2 print(i)
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2017/11/6 16:45 # @File : leetCode_657.py ''' 思路, U,D,L,R 分布对应+1, -1操作,最后比较值即可 ''' class Solution(object): def judgeCircle(self, moves): """ :type moves: str :rtype: bool """ steps = { "U": 1, ...
class account: def check_password_length(self, password): if len(password) > 8: return True else: return False if __name__ == '__main__': accVerify = account() print('The password length is ' + str(accVerify.check_password_length('offtoschool')))
""" Some useful data sets to be used in the analysis The command :func:`sequana.sequana_data` may be used to retrieved data from this package. For example, a small but standard reference (phix) is used in some NGS experiments. The file is small enough that it is provided within sequana and its filename (full path)...
class Node: def __init__(self, init_data, pointer = None): self.data = init_data self.pointer = pointer def get_data(self): return self.data def get_next(self): return self.pointer def set_data(self, data): self.data = data ...
#--- Exercicio 1 - Variávies e impressão com interpolacão de string #--- Crie 5 variávies para armazenar os dados de um funcionário #--- Funcionario: Nome, Sobrenome, Cpf, Rg, Salário #--- Os dados devem ser impressos utilizando a funcao format() #--- Deve ser usado apenas uma vez a função print(), porem os dados deve...
def tennis_set(s1, s2): n1 = min(s1, s2) n2 = max(s1, s2) if n2 == 6: return n1 < 5 return n2 == 7 and n1 >= 5 and n1 < n2
class people: def __init__(self): self.nick_name = "" self.qq_number = "" self.topic_name = "" def display(self): print("------------------------topic_name = %s------------------------" % self.topic_name) print("nick_name = ", self.nick_name) print("%-13s%s" % ("...
def get_object_or_none(model, *args, **kwargs): try: return model._default_manager.get(*args, **kwargs) except model.DoesNotExist: return None def get_object_or_this(model, this, *args, **kwargs): return get_object_or_none(model, *args, **kwargs) or this
class Solution: def merge(self, nums1, m, nums2, n): i=m-1 j=n-1 tmp=m+n-1 while i>=0 and j>=0: if nums1[i]<nums2[j]: nums1[tmp]=nums2[j] tmp-=1 j-=1 else: nums1[tmp]=nums1[i] tmp-...
# -*- coding: utf-8 -*- # {name: (aka, width, height, aspect ratio)} HIGH_DEFINITION_MAP = { "NHD": ("nHD", 640, 360, (16, 9)), "QHD": ("qHD", 960, 540, (16, 9)), "HD": ("HD", 1280, 720, (16, 9)), "HD PLUS": ("HD+", 1600, 900, (16, 9)), "FHD": ("FHD", 1920, 1080, (16, 9)), "WQHD": ("WQHD", 2560...
def shape_legend(node, ax, handles, labels, reverse=False, **kwargs): """Plot legend manipulation. This code is copied from the oemof example script see link here: https://github.com/oemof/oemof-examples/tree/master/oemof_examples/oemof.solph/v0.3.x/plotting_examples """ handels = handles labels =...
''' Windows OS В операционной системе Windows полное имя файла состоит из буквы диска, после которого ставится двоеточие и символ "\", затем через такой же символ перечисляются подкаталоги (папки), в которых находится файл, в конце пишется имя файла (C:\Windows\System32\calc.exe). На вход программе подается одна стр...
def remove_background(frame): fgbg = cv2.createBackgroundSubtractorMOG2(history=20) fgmask = fgbg.apply(frame) kernel = np.ones((3, 3), np.uint8) fgmask = cv2.erode(fgmask, kernel, iterations=1) res = cv2.bitwise_and(frame, frame, mask=fgmask) return res # gamma transfer def gamma_trans(img,gam...
def urlify(str, length=None): """Write a method to replace all spaces with '%20'. Args: str - String whose spaces should be replaced by '%20' length - length of str minus any spaces padded at the beginning or end Returns: A string similar to str except whose spaces have been replace...
class ElectricalDemandFactorRule(Enum, IComparable, IFormattable, IConvertible): """ This enum describes the different demand factor rule types available to the application. Within a demand factor a rule will be referenced and the user will have to enter values corresponding to that rule. ...
#as a list: l=[3,4] l+=[5,6] print(l) #as a stack: #top input #lifo l.append(10) print(l) l.pop()#pops the ele that is inserted at last #as a queue #fifo l.insert(0,5) l.pop()
print('Hello World!') long_mssg = """ ................................................. This script should be replaced for an AI-script of your own which has an output of some sort that you are interested in getting ................................................ """ print(long_mssg)
#--------------------------------------------# # My Solution # #--------------------------------------------# def checkio(words: str): count = 0 for word in words.split(): if word.isalpha(): count += 1 else: count = 0 if count == 3: return True return False #-----------------------------...
def render_vehicle(vehicle): msg_pattern = u""" <a href=\'%(tankopedia)s\'>%(name)s (%(nation)s)</a> %(prem)s%(type)s %(level)s уровня Цена: %(cost)s <i>%(descr)s</i> <a href=\'%(image_url)s\'>&#160;</a> """ context = { 'tankopedia': vehicle.tankopedia_url, 'name': vehicle.get_loc_name(), ...
class Player: def __init__(self, type_): self.hp = 200 self.type = type_ def combat_simulation(f): map = [] players = [] for line in f.readlines(): row = [] for c in line.strip(): if c == '#': row.append(False) elif c == '.': ...
# a=int(input('Enter a No.: ')) # s=0 # for i in range(1,a): # if a%i==0: # s+=i # if s==a: # print('Perfect No.') # else: # print('Not a perfest No.') # a=9 # b=7 # c='12' # print((c*(a*b))*'\n' # for i in range(1,183): # print(chr(i),end="") # a='·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇ' # print(len(a)) a...
"""Constants for testclient.""" # these have different places than in the gateway PLUTO_PSK = '/tmp/psk.txt' PLUTO_PIDFILE = '/tmp/pluto.pid' OPENL2TP_PIDFILE = '/tmp/openl2tp.pid' POOL_SIZE=5
# created by RomaOkorosso at 21.03.2021 # config.py db_url = "postgres://USER:PASSWORD@IP:PORT/DATABASE_NAME"
def tree_transplant(self, u, v): if(u.pai == None): self.raiz = v elif(u.pai.left == u): u.pai.left = v else: u.pai.right = v if(v != None): v.pai = u.pai
""" Baseline training file used in app production ----------------OBSOLETE---------------- import os import sqlite3 from sklearn.linear_model import LogisticRegression from basilica import Connection import psycopg2 # Load in basilica api key API_KEY = "d3c5e936-18b0-3aac-8a2c-bf95511eaaa5" # Filepath fo...
"""Test case for variable redefined in inner loop.""" for item in range(0, 5): print("hello") for item in range(5, 10): #[redefined-outer-name] print(item) print("yay") print(item) print("done")
def longestWord(sentence): wordArray = sentence.split(" ") longest = "" for word in wordArray: if(len(word) >= len(longest)): longest = word return longest print(longestWord("Hello World"))
c = str(input()) if c[0] == c[1] == c[2]: print("Won") else: print("Lost")
class Node: def __init__(self,data=None): self.data=data self.next=None class LinkedList: def __init__(self): self.head=None def showlist(self): while self.head is not None: print(self.head.data) self.head=self.head.next list=LinkedList() list.head...