Questions tagged as 'python-3.x'

1
answer

How to integrate and make queries with pymongo?

I'm learning to integrate Python and MongoDB, and because of that, I set myself a challenge: to create a small program to register football players. My program has two modules, info_player and info_team. My intention is to run the program int...
asked by 07.11.2017 / 12:06
1
answer

Call Functions in Python 3

Hello, I was "playing" without Python, and I decided to do a mini-game, for the PC to play Jokempô with me (I AM INITIATING IN PROGRAMMING). while pj <5 and pc <5: def game() But I came across the following problem. def game()...
asked by 04.10.2017 / 14:59
1
answer

Images with Django - display and static

I'm a beginner in Django and I'm developing a simple blog. I know that the configuration of the static files needs to be different for the development and production environment, but I always get caught up in understanding how it works sin...
asked by 04.10.2017 / 17:40
1
answer

Passing a list of objects to a dictionary in python

I have a list of objects: lista_objetos = ['acarreta', 'afeta', 'alavancagem', 'apropriadas', 'arvore', 'avaliacao'] Each object stores information, including the information itself, eg: afeta.palavra is equal "afeta" ....
asked by 08.11.2017 / 13:05
1
answer

How to use objects.filter in django?

Good afternoon, I have a model here in my django Subject, and I want to make the listing of it in the html, however every subject has as foreign key the id of the model category, as I make a variable to receive the objects.filter only of the sub...
asked by 24.11.2017 / 15:46
1
answer

numpy delete method doing strange thing

I was testing the delete method of the array class of the numpy library and something strange happened: I delete the index element 0 from the array, but the index element 1 is excluded. I am not understanding what this delete is doing >>...
asked by 16.10.2017 / 09:44
1
answer

Problem with reading files in python

What is the difference between making python open and reading a file, passing the reading result between blades? When I open a file that contains only the word test and I pass this result from the read by a hash algorithm the result is:...
asked by 09.09.2017 / 02:54
1
answer

Validation of login information does not work

Doubts are throughout the program import string alphabet = list(string.ascii_lowercase) n = range(0, 10) name = input('Digite seu nome de usuário:') if name in n: while True: print('Apenas letras são permitidas na nomeação do...
asked by 04.12.2017 / 20:27
1
answer

Decompose the value of a ballot in Python

I need to read an integer value and calculate the smallest number of possible banknotes in which the value can be decomposed. The grades considered are 100, 50, 20, 10, 5, 2 and 1. And dps print the read value and then the minimum amount of n...
asked by 12.08.2017 / 22:15
1
answer

Capture groups where a specific word appears with Regex

I have the following situation: text_1 = O cachorro correu com o gato text_2 = O carro passou e o cachorro foi atrás text_3 = Sempre que chego em casa meu cachorro pula em mim text_4 = Ele foi correndo atrás do sonho text_5 = O cachorro latiu...
asked by 10.08.2017 / 18:49