print('-----')
print('TESTE')
print('-----')
print()
lista = ['Joao', 'Joaozinho', 'Rafael']
print(lista)
var = str(input('Digite algum dos nomes da lista:'))
if var == 'Joao' or var == 'João' or var == 'joao' o...
How can I assign a method to a module in Python or even access the source file of this module? I tried using the __file__ attribute, as shown below, but returned the error saying that the module does not have such an attribute.
>>...
This is the code I wrote.
n_alunos=input('')
x=0
idades=[]
alturas=[]
while x != n_alunos:
x+=1
n=raw_input('')
a=n.split(" ")
idades.append(a[0])
alturas.append(a[1])
How do I transform the elements of the 2 string lis...
If I put for example the name:
roberto fair da silva
using title it looks like this:
Roberto Justo Da Silva
How do I make the command title do not modify the word 'da' to look like this:
Roberto Justo da S...
I'm trying to learn Python (and programming in general). At the moment, I'm studying if and else and conditions and, or and not. I'm training by doing a quiz about star wars, but I'm having a hard time.
Score = 0
Resposta1 = input("No filme S...
ConvInicial = str(input('Você: '))
if ConvInicial == 'Não estou passando bem' or ConvInicial == 'Estou com dor' or ConvInicial == 'Preciso de ajuda':
print('O que você está sentindo?')
RespDor = input('Você: ')
if RespDor == 'Estou com dor de ca...
I made a simple algorithm that solved Fibonacci in 2 logical operations inside the loop. I decided to look for a better way and found a version that does in only 1 calculation in of the loop. It worked perfectly, but when I went to understand...
There is some code that adds the elements of two lists, for example:
A=[1,2,3,4]
B=[2,4,5,6]
D=[3,6,8,10] # o elemento 3 e a soma dos elementos 1 e 2 da lista A e B
I need to represent holidays and in my holiday class I need to set the start date and end of the holiday. As the start and end date I need to enter only the month, day, hour and minute . But the datetime class of python requires that the year...