Posts by Raphael Rodrigues • 67 points
6 posts
-
0
votes1
answer1405
viewsA: Valueerror: could not Convert string to float:
On line 7 you are initiating the class with the Current attribute = "". self.current = "" So in function sum_of_total, line 29 you try to convert the value of Current to float... self.current =…
pythonanswered Raphael Rodrigues 67 -
0
votes1
answer399
viewsA: How to install PIP in Odoo’s.txt file
On the Trustcode page on Github there is a repository with an installation tutorial of Odoo with the Trustcode applications for the implementation of the Brazilian accounting and fiscal rules. In…
-
2
votes1
answer75
viewsA: Custom function for the Sorted function in python 3.x
Use the cmp_to_key method of the functools library Will stay this way: import functools def numeric_compare(x, y): return x - y print(sorted([5, 2, 4, 1, 3],…
-
0
votes2
answers1944
viewsA: How to repeat a code?
Use a while to run the repetition with a parameter to stop the repetition, I’m posting your code being executed inside a While that repeats the code until when the user chooses the output option by…
-
1
votes2
answers421
viewsA: Doubts of python
On the line that prints the date, try this way: print('[b]Data da aula:[/b] [color=#0000ff] [b]{}[/b][/color]'.format(now.strftime('%d/%m/%Y')))
-
-2
votes2
answers247
viewsA: How to sort a list by the number of occurrences? In Python
Try this way: from collections import Counter lista = [1,1,2,3,3,3] print [item for items, c in Counter(lista).most_common() for item in [items] * c] # [3, 3, 3, 1, 1, 2]…