Questions tagged as 'python-3.x'

2
answers

Multiplication of matrices

Could you give a help with Array in python ?! The exercise is as follows, a matriz_mult(n1, n2) function receives two arrays as a parameter and returns True if the arrays are multiplied in the given order and False otherwise...
asked by 01.03.2017 / 20:43
1
answer

How to add elements in the tuple using a function?

def funcao(): int(input('insira um número:')) tupla = (funcao(), funcao(), funcao(), funcao()) print(tupla.count(9)) print(tupla) insira um número:9 insira um número:9 insira um número:9 insira um número:9 0 (None, None, None, None) P...
asked by 28.10.2018 / 05:15
2
answers

Get specific column csv with python

I have a method that opens a CSV file but I would like to go directly to a specific column, I tried to do list2 = [row.split()[3] for row in f] , but it returns a piece of the file, not the column. Is it possible to do this without using P...
asked by 08.10.2018 / 23:02
2
answers

Check if directory 'B' is inside directory 'A'

I'm developing a script that checks the last access date of each file within every tree of a chosen directory. Files with more than X days without access will be moved to another directory. As a precaution, I need to be detected if the destinati...
asked by 20.10.2018 / 17:12
1
answer

Force the implementation of certain type of abstract method

In Python it is possible to define classes abstratas and métodos abstratos in a slightly simple way, for example: class Spam(ABC): @abstractmethod def grok(self): pass This class can not be instantiated...
asked by 22.10.2018 / 03:36
1
answer

Is this a Python 3.6 bug?

The following code is a demonstration of what I'm trying to do: I have a vector ( todos ) in which elements are added. The second vector ( alguns ) also receives new elements, and we need to know if elements of alguns are alre...
asked by 15.11.2018 / 13:52
2
answers

name is not defined - name / variable not defined, tkinter and slite3 help

I'm starting to study sqlite3 on the go, and this is difficult, but I've already got some things, the problem is that when compiling the program the following error appears: "name 'adic' is not defined". Follow the code: from tkint...
asked by 09.08.2018 / 05:12
3
answers

Remove comment tag and its contents in Beautifulsoup 4

How do I remove the comment tag along with its contents with bs4? <div class="foo"> A Arara é um animal voador. <!-- <p>Animais Nome: Arara Idade: 12 anos e 9 meses Tempo de Vida: 15 anos --> </div>     
asked by 27.12.2018 / 17:56
2
answers

Function remove in a list changes elements in another Python3

def almostIncreasingSequence(sequence): x = sequence for i in range(len(x)): sequence = x cont = 0 y = False sequence.remove(sequence[i]) for j in range(len(sequence)): try: if sequence[j] < sequence[j+1...
asked by 11.07.2018 / 01:09
1
answer

Why are you playing the Windows error sound instead of the specified file?

import winsound winsound.PlaySound('C:/Users/Computador/Music/Action!/som1.wav', winsound.SND_ASYNC) When I run this script it does not touch the som1.wav file, but rather the Windows error sound. Why?     
asked by 03.08.2018 / 01:27