Posts by taynan • 55 points
9 posts
-
1
votes1
answer848
viewsQ: Add an element that is not in the array
I’m new to C, I’ve been trying to find a way to do this program but always returns a result that I can’t understand when printing the array for visualization. Example of entered values:…
-
0
votes6
answers7088
viewsQ: Intersection between two sets (element that is in set A and B at the same time)
I’m trying to make a function that returns the intersection between two sets: def intersecao(conjuntoA, conjuntoB): inter = [x for x in range(1,12) if x in conjuntoA and conjuntoB] return inter a =…
-
0
votes2
answers569
viewsQ: Dictionary file
I am trying to turn a file into dictionary but is giving the following error: Traceback (Most recent call last): File "C: Users taynan Appdata Local Programs Python Python36-32 Project CRUD…
-
1
votes1
answer46
viewsQ: Open files that will be shared between various functions, inside or outside the functions?
Next, I’m making a program that I’m going to divide between the function module and the interface, and I need to use files in this project (and I can’t use classes), it turns out I need to use these…
-
0
votes0
answers1237
viewsQ: How to add new keys to a dictionary?
Next, I’m doing a program that’s an academic control system, it turns out that when it comes to adding teachers, for example, it’s not creating new keys for teachers in the dictionary. He’s simply…
-
0
votes0
answers380
viewsQ: Replace matrix elements with an "X"
I have code that should print a matrix according to the input. You should print the matrix so that the "X" forms a right spiral starting from the middle, someone has some idea? ps.:Code comments are…
-
1
votes1
answer164
viewsQ: Error in dictionary key
I am trying to store dictionaries in a list and then print according to the position in the list, however this giving an error in the key... Code below: nome = "nomedahora" cpf = "1421241"…
-
1
votes1
answer439
viewsQ: I calculate to buy fuel by value?
I am doing a program of a fuel pump using classes, but I am not able to calculate the amount of fuel for the value inserted, someone can give a light? class BombaCombustivel(): def __init__(sel,…
-
-2
votes1
answer171
viewsQ: Can anyone tell me where the bug is please? Is giving "invalid syntax"
n = str(input("Informe o nome do aluno: ") m = int(input("Informe o numero da matricula do aluno: ") print("O nome do aluno é: %s, o numero da matricula é: %d" %(n,m)) …