I'm developing some middlewares and delving into the Django source code I came across the following:
class MiddlewareMixin:
def __init__(self, get_response=None):
self.get_response = get_response
super().__init__()
de...
I have the following structure in my code:
for c in range(0, len(str(ListaTemp[4]))):
for c2 in range(c+1, len(str(ListaTemp[4]))):
if str(num)[c] == str(num)[c2]:
valido = True
And so. My teacher is going to give on...
I came up with the following function:
def func6a(lista):
maior = 0
for el in lista:
if type(el) == list:
maior = func6a(el)
else:
if len(el) > maior:
maior = el
return m...
I have a function that reads line by line a TXT file to disk and formats it extracting only what interests me, getting a list like this:
Swi 04/11/2018 Basel Lugano 3 2 2 0
Swi 03/11/2018 Grasshopper Young Boys 0 3 0 0
Swi 04/11/2018 Luzern Zü...
How do I delete a column from a csv file?
example:
nome;nota;idade
joao;10;12
maria;8;13
jose;6;8
to look like this:
nome;idade
joao;12
maria;13
jose;8
How do I put a new column of this file into another file?
I'm still learning pro...
Hello, I need to know how I can assemble a class that can not have attributes implemented after the instance. Ex:
class Foo(object)
def __init__(self, a='hello', b='world')
self.a = a
self.b = b
__setattr__(self, key,...
For example, we can use this code to assign the value to a variable:
idade = input('Digite sua idade: ')
What I would like to know is if, instead of assigning a value to a variable, is it possible to create a variable by naming it with...
I'm using a filter to return some student and update their data, however when I try to save I get the following error:
Student with this CPF already exists and Student with this RA already exists.
My views.py :
from django.s...