Questions tagged as 'python-3.x'

1
answer

How to factor n! or

How to factor a number? n! or! n Example: Let's take x = 5 x = input('Digite um número inteiro: ') i = 1 while i <= x: for i in range(x): i = i + 1 a = [] a.append(i) print(a) break...
asked by 08.07.2017 / 21:38
1
answer

TypeError: len () of unsized object how to solve

def invert_map(x): y = _np.empty_like(x) y[x] = _np.arange(len(x)) return y Result gives this in this function:    File "E: \ Anaconda3 \ lib \ site-packages \ arlpy \ comms.py", line 74, in invert_map      and [x] = _np.arange...
asked by 18.07.2017 / 03:56
1
answer

What is the function of print ('\ a') in python

I was told that the print('\a') function of this code produces a beep, but at the time when I run on pycharm there is no beep. I would like to know what this function is for. And if they could send me a type of print function list, exa...
asked by 30.06.2017 / 01:41
0
answers

conversion from Unittest Python2 to Python3

I'm having some free time and I'm upgrading to Python3. I came across a problem in running the unittest, and I believe you can help me. Error: File "/home/brito/projetos/00-incolumepy/tests/generators_test.py", line 28 self.assert_([...
asked by 10.07.2017 / 14:09
1
answer

Open files that will be shared between various functions, inside or outside the functions?

Next, I'm doing a program that I'm going to split between the function module and the interface, and I need to use files in that project (and I can not use classes), so I need to use those files between several functions, they will write in them...
asked by 25.06.2017 / 17:46
0
answers

How to add new keys to a dictionary?

Next, I'm doing a program that is an academic control system. It happens that when it comes to adding teachers, for example, it is not creating new keys for teachers in the dictionary. He is simply replacing them Here are the functions to add an...
asked by 24.06.2017 / 22:27
1
answer

Make custom select on DJANGO

model.py class Produto(models.Model): nome=models.CharField('nome', max_length=100) marca=models.CharField('nome', max_length=100) categ=models.ForeignKey(Produto, verbose_name='Produto') class Categ(models.Model): cate...
asked by 22.06.2017 / 21:42
1
answer

Image problem on a tkinter button

I want to put image on the buttons, I've done this before, but agr n is working. Can you help me? ** Detail: ** In the same tkinter window is instantiated the screen of a turtle. def images(self): imgAdd = tk.PhotoImage(file='./Images/a...
asked by 05.07.2017 / 03:55
0
answers

Replace elements of an array with an "X"

I have code that should print an array according to the input. You should print the matrix by having the "X" form a spiral right from the middle, does anyone have any ideas? ps.:The code comments are the attempts while True: tamanho = in...
asked by 09.06.2017 / 14:29
1
answer

Python No if error

I'm having an error in if and I do not know how to fix this error, I'm using Python 3.6 and Pandas for reading, writing and data analysis. df1 = pd.read_csv("JonnyTheBoy10.csv", usecols=['ART_TIPO', 'ART_DESIG', 'PORTA', 'CP4', 'CP3', 'LOCALID...
asked by 09.06.2017 / 11:05