I have the following text:
'box 1 is blue, box 10 is green, box 100 is empty'
I want to replace 'box 1' with 'package 2', so I do:
>>> texto = 'caixa 1 é azul, caixa 10 está verde, caixa 100 está vazia'
>>> print(te...
I'm trying to validate a simple form in Python 3 and I want to prevent it from registering the information if the nome field is empty, but when I make a if to check that the name variable is empty, it it returns me that it i...
I have the following code:
test = input ("CPF: ")
When the CPF is entered:
12345678900
But when I return this input it returns:
123.456.789-00
How do I do this in Python?
I have to do a function and I am not able to develop logic. It is as follows:
Write the remove_repetitions function that receives a list of integers as a parameter, checks to see if such a list has repeated elements, and removes them. The...
How can I create a command line tool in Python that works like ls of Linux or dir of Windows?
How would I start a script like the one that will later be compiled as an executable?
I'm starting to program in python and I've been trying to use best practices: virtualenv, pip, etc.
One of the packages I have used (pelican) has different help pages for each version. How do I know which version I am using?
I installed it with...
The client:
from socket import *
serverHost = 'localhost'
serverPort = 50007
# Menssagem a ser mandada codificada em bytes
menssagem = [b'Ola mundo da internet!']
# Criamos o socket e o conectamos ao servidor
sockobj = socket(AF_INET, SOCK...
I would like to ask the user to type something and find out what type of what he wrote. So far I only know input() , but input() only returns String type. If I by int(input()) or float(input()) fall into the sam...
I'm a beginner in sending emails through a script and I'm having a problem. Use Python 3.5. When sending attachments with the following script, they lose the extension and are renamed:
def enviaremail(usuario,senha,mensagem,listadestinatarios)...