I'm pretty early in the Lambda function study and I'm pretty lost. I know the code could only be done with the "sum" function but I want to learn the Lambda syntax.
a = []
for b in range(0, 4):
c = int(input())
a.append(c)
d = (lambda...
Hello.
How do I limit the number of digits I can put in a Entry of module Tkinter ?
from tkinter import *
root = Tk()
entrada = Entry(root) #Quero limitar para que nesse entry, possa colocar
apenas 8 digitos
entrada.pack()...
I want to return the largest and smallest string .
See:
nl=str(input('Digite uma string'))
String=[]
string.append(nl)
while caractere != 'pare':
caractere = str(input("Digite uma letra ou número "))
string.append(caractere)
A...
For example, I'm writing a code
def soma():
n1=int(input('digite um numero'))
n2=int(input('digite outro'))
soma = n1+n2
print('A soma de {} e {} é {}'.format(n1,n2,soma))
#começo do programa
p=input('Você deseja somar?')
if p=='sim...
I'm trying to create a regex that is able to find a string in a text even though there is some white space in the middle of the words. For example, I search the text for the following excerpts
"impaired conciliation" or even "irreconcilable"...
I'm working on data analysis using Python and for this I'm training algorithms like SVC and K-means. The data used for the training have a fixed spacing between each sample, since they are sampled by an oscilloscope in fixed periods of time, in...
Good morning!
I have a project that I am improving and would like to do a For i to run all the variables within the project, however when running it applies the project only to the last variable.
Code:
for i in ['1', '2', '3']:
a...
In python 2.x I can pass a custom function to sorted function, how to do this in python 3.x?
Basically convert the code below
def numeric_compare(x, y):
return x - y
print(sorted([5, 2, 4, 1, 3], cmp=numeric_compare) )
I am sending the second string via post (JavaScript) to my bootle server (Python):
query = {
'wiki': 'Tr%E1%BA%A7n_H%C6%B0ng_%C4%90%E1%BA%A1o',
'uid':'f17afd66aae3a'
}
$.post(url, query, function(data, status){}):
But when I print what I g...