Questions tagged as 'python'

1
answer

Code is jumping lines - Python

Good afternoon! I would like some help in my project that looks for words (file: Variables.txt) within another (Answers.txt) file and makes the markup Find a word. But by jumping some sentences leaving the final text (Result.txt) blank....
asked by 26.04.2018 / 20:15
1
answer

Python: 'int' object is not iterable Random function

I'm having this error when I run the code. If I set pos=(algum numero qualquer) the code runs normally, but if I use this random function of the error.    'int' object is not iterable on line 20 at the beginning. Where am I goin...
asked by 01.04.2018 / 20:18
1
answer

Doubt beginner! Manipulating series

I'm doing my first analysis with Pandas in Python 3. I'm practicing with a game of thrones dataset that contains the killings in the books. One of the columns in the dataframe refers to the house and in this column there are repeated values o...
asked by 06.05.2018 / 14:58
1
answer

Multiplication Algorithm by sum to any integer

I have to develop a multiplication algorithm by adding to any integer in the most optimized way possible. I thought of the following: x*y=z;x,y belongs to integers, so z=x+x y times. I know almost nothing about programming, but...
asked by 06.05.2018 / 22:51
1
answer

Graphs algorithm to solve Sudoku

I am having a doubt, my code when it runs on one of the Sudoku examples, it printa in the end the expected result, the other sudoku example it does not correctly print the expected result. I wonder what's going on, try to understand import net...
asked by 28.03.2018 / 23:23
1
answer

How do I avoid repeating commands through a function?

I'm creating a program to do some mathematical accounts with some commands and have 1 line of code that repeats in all conditions, with only a small change in each condition. My question is how to create a function to call it instead of typing t...
asked by 28.03.2018 / 20:48
1
answer

Python Library

Is there a place where I can query Python commands and functions in Portuguese? Eg If I want to know about a command or module like numpy or pandas? I noticed that a lot of the information is in English, for example if I give a help ('prin...
asked by 28.03.2018 / 18:40
1
answer

Geany Text Editor

I'm using geany for programming in python and I need to change the background color of the text editor, I'm using it in debian does anyone know how to do it?     
asked by 30.05.2018 / 02:33
1
answer

What's the difference between these forms of command execution?

These commands in Python: lista = eval('[' + input("Digite sua lista: ") + ']') And this: lista = input("Digite sua lista: ") And this: lista = [int(x) for x in input().strip()] Why does the latter give the error below?    Valu...
asked by 29.05.2018 / 18:07
1
answer

Condition with letter in Python

I want to be a simple example of: test = input('Letra: ') If the letter you typed is 'a' (here I have a problem) print('exemplo') I want you to see a message when you type "a" ..........     
asked by 23.04.2018 / 21:44