Questions tagged as 'python'

1
answer

Discover percentage in repeated numbers - Python - Statistics [closed]

Good morning everyone. I need to solve a statistical problem. But I find it difficult to find the percentage of the grouped numbers that repeat themselves. can anybody help me? Thanks in advance, follow code: import os import math import numpy...
asked by 28.06.2017 / 13:30
1
answer

Error "zero is not a supported scheme"

I'm trying to use CouchDB together with Python, I installed them correctly, I went to CouchDB and I created a user, when I go to the Python compiler and execute: import couchdb couch = couchdb.Server('zero:central@http://localhost:5984') db =...
asked by 26.10.2017 / 15:44
1
answer

Pygame - How to solve ghost image effect

I'm doing tests on pygame and created a "character" that moves, however it creates a ghost effect on the screen. I would like to know how to solve it. (Thislandiswhatthecharacterwouldbe)TheghosteffectthatIamreferringtoisthatwhenyoumove,thechara...
asked by 20.05.2017 / 23:59
1
answer

vectordouble using ctypes for dll in python

I have a .dll inside it that has a BUBBLE function that returns a double. The problem is that BUBBLE has a vector<double> in the argument. extern "C" minhaDLL_API double BOLHA(vector<double> OI); In fact it has a ex...
asked by 10.04.2018 / 02:57
1
answer

help with Qlocale and format currency brazil

In c ++ I used to convert an integer value to the Brazilian currency format as follows: QLocale loc = QLocale::system(); QLocale brasil(QLocale::Portuguese); loc.setNumberOptions(brasil.numberOptions()); QLocale::setDefault(loc); cout <<...
asked by 28.01.2017 / 21:34
1
answer

Python - How to print multiple variables in loop?

I am collecting 7 different values through a while . Whenever while is rotated, a value is assigned to variable valor and is printado , but I would like to save each valor to a variable for later use. For exam...
asked by 13.04.2017 / 15:38
1
answer

PYTHON - NIM game (problem with computer fix start or not)

Goal You should write a program in the Python language, version 3, that allows a "victim" to play the NIM against the computer. The computer, of course, should follow the winning strategy described above. Let n be the starting number of pi...
asked by 13.04.2017 / 04:23
2
answers

Sum of elements in lists

[[3, 2, 7], [8, -2, 5], [-1, 4, 3], [2, 2, -9]] Next, it saves in three different variables, ignoring the negative values, the sum of the elements separately. That is, the sum of the first element of each sublist, the sum of the second element...
asked by 11.04.2017 / 12:49
2
answers

Relationship with Django Admin

I'm a beginner with Python and Django and I'm doing a generic menu, I'd like to know how to list in the Django Admin menu-related items in the Menu ModelAdmin class Menu(models.Model): menu = models.CharField('Menu', max_length=150)...
asked by 31.07.2017 / 23:18
1
answer

How to get a correct value using the point?

preco_casa = float (input("Qual o preço do imóvel?")) seu_salario = input("Qual o seu salário mensal?:") anos_a_pagar = input("Quantidade de anos a pagar pelo imóvel:") valor_prestacao = preco_casa / (anos_a_pagar *12) print (" O valor da prestaç...
asked by 04.08.2017 / 17:40