Questions tagged as 'python-3.x'

3
answers

How to create a variable through the user-typed response in Python?

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...
asked by 30.12.2016 / 16:58
2
answers

Django + Python update and not insert

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...
asked by 03.09.2018 / 16:34
2
answers

Compare Python index-independent lists

Good afternoon, I need to compare 2 lists and when a certain value in the 'name' field of list 1 does not exist in the 'name' field of list 2 perform some function. The way I did is comparing index by index and executing if every time the...
asked by 08.08.2018 / 22:49
1
answer

how can i make a russian roulette in simple python

I wanted a simple scrip where it counts up to 6 using while or another replay method. and will have a list with 5 flawed and 1 died and he counts up to 6 raffling this list and when he speaks died he wanted her to look like. but in my script it...
asked by 04.05.2018 / 01:58
2
answers

How to get only numbers in parentheses in Python with regular expression

Texto = "54 oz (163 g)" I want the result to be only 163     
asked by 09.04.2018 / 05:41
2
answers

Linear Regression with python

I need to do the linear regression calculation, but I read that there is no possibility to use / install scipy on windows. Are there any other libraries similar to scipy for this type of calculation? Or if there is some way to install scipy on w...
asked by 07.05.2017 / 01:05
1
answer

How to do searches inside the code in Python

Hello, I would like to make a code that when I type, for example, "product_name", it will check if there is any word with the name that I typed and return a value, example "200 reais". But I have no idea how to start, I'll be grateful if anyone c...
asked by 28.05.2017 / 18:48
2
answers

Why can not variables in the same instance be read in different processes? (Python)

I have two processes going on and I have a class containing a method that modifies a value, as you can see in the code below. The ButtonObject function represents a click, to modify a value. But the question is, why does the change only occur wi...
asked by 23.01.2018 / 11:26
2
answers

Formal definition of operations = e ==

What is the formal definition of using = and == in Python? I can identify in the examples when I have to use which, but when I try to identify these operations by a formal definition as (more or less as if it were a mathematical co...
asked by 29.09.2018 / 03:37
3
answers

is not accumulating values in lists

list1 = list () list2 = list () def read and verify ():     "" reads an integer and checks to see if this returns the read integer "" " while True: try: inteiros= int(input("entre com numeros1 ")) inteiros= int(input(...
asked by 20.10.2018 / 20:43