Posts by Ronnald Machado • 46 points
5 posts
-
1
votes1
answer168
viewsQ: Python constructor with **kwargs
I would like to know if the use of **kwargs in a constructor is the best alternative or if there is a better path for similar cases to the one below: class Duvida(object): def __init__(self,…
-
0
votes2
answers153
viewsA: How to read 4 numbers at once, and such numbers should be separated only by space?
To receive more than one parameter through the input you can use: nota1, nota2, nota3, nota4 = input().split(" ") This way the console will wait for an entry with 4 values separated by space. Ex 9.0…
python-3.xanswered Ronnald Machado 46 -
0
votes1
answer34
viewsA: I’m having trouble printing database values
By the type of error it seems that the user list you are trying to update is not initialized in the corresponding keys. However, starting from the premise that the user list has been initialized and…
python-3.xanswered Ronnald Machado 46 -
0
votes2
answers1032
viewsA: How to find the second smallest value of a python array without using built-in functions?
First you can use the SET to organize the data, ensuring the ordination and the absence of duplicate copies. array = [2, 3, 6, 6, 5] copia = set(array) The content of the copy variable is…
-
1
votes2
answers920
viewsA: Turn string into operator
I am assuming that your input string always has the format "NoperatorN" where N is the number present in the string. If NoperatorM the solution will not work.…