Questions tagged as 'python-3.x'

1
answer

NLPS parsing with external list

Parsing: An input text that will pass through the grammar and output are all entries that the grammar finds in the text. The problem is that my non-terminals are external list files and I can not visualize a way to do it. Example of a pseudo-...
asked by 31.08.2017 / 16:40
1
answer

Class polynomial - list assignment index out of range

I'm not sure how to do this, but I'm not sure how to do this.    File "/home/leticia/Documentos/python/Poo/polinomio.py", line 30, in          p3 = p1 + p2 File "/home/leticia/Documentos/python/Poo/polinomio.py", line 19, in    add       ind...
asked by 31.08.2017 / 18:44
1
answer

How to sum the values of an index?

I'm new to python and need to do a program that adds the digits that belong to the same position in a list, for example: Lista = ['22659', '387685', '89546'] The result of the sum of the list [0] would be 24 (2 + 2 + 6 + 5 + 9), putting all...
asked by 20.09.2017 / 20:15
1
answer

Error trying to reinstall Python [closed]

My Python was installed on the partition "D:" (on a normal HD) and my OS on "C:" (on an SSD). I moved the SDD (Partition "C:") from my old computer to a new one and tried to reinstall python on it, however I get a message that it is installed on...
asked by 23.08.2017 / 17:14
1
answer

Know years, months, days, hours, etc ... That have passed since a certain date

I would like to know how I make the output of the difference between two dates stay the way I want, in this case I would like it to be:    Since 16 - 07 - 2014 23:00:00 have passed: X years, Y months, K days, Z hours, W minutes, S secs Wh...
asked by 28.07.2017 / 15:54
1
answer

How to print a particular list from a string of a .csv using python

The first part that is to detect the position of the list I have already achieved, the problem is at the time of the else , I would like to know a method that causes the else not to be printed together with if . Code and the "database" below...
asked by 08.08.2017 / 22:04
1
answer

function to return the integer

What am I doing wrong in my role? num2 = float(input("digite um número não inteiro: ")) def arrend(numero): if num2 - math.floor(num2) < 0.5: numero = math.floor(num2) return numero return math.ceil(num2) print("...
asked by 30.07.2017 / 01:38
1
answer

Parameter in the page URL

Sorry, I need to create a pyramid application to use the API . 1 - "/ quotes / < quote_number > "- Display page containing the quote returned by the API corresponding to < quote_number >. I already know how to create a statistical p...
asked by 10.09.2017 / 05:49
4
answers

Comparing list indexes in python?

Good afternoon guys, I'm having trouble with lists in python ... lateral = [] for i in range(3): lateral = float(input("Por favor, informe o valor de cada lado, seguidamente:" )) if(lateral[0] == lateral[1]) and...
asked by 20.07.2017 / 18:38
2
answers

error converting string to float in python

Hello, I'm having a problem I'm not getting conveter string for float The program takes the price of a game dps converts to string and positions through the character and I am not able to convert price =game.find(attrs="col search_price d...
asked by 11.06.2017 / 23:22