Posts by Codigo de Senior • 562 points
25 posts
-
0
votes3
answers79
viewsA: Search python data dictionary
first let’s go through the dictionary with a for dict = {'dado1': 'teste01', 'dado2': 'teste002', 'dado3': 'teste0004050'} tupla = [] for key in dict: pass Next we will add the len of the `string,…
python-3.xanswered Codigo de Senior 562 -
1
votes1
answer197
viewsA: Visualg does not recognize the "fimse"
You are opening several(only 3, forgot 2) se but only closed one, is not that it does not recognize, only you who forgot to close. The code will look like this: Algoritmo: Algoritmo "semnome" //…
-
1
votes2
answers196
viewsA: Code to generate random number sequence does not work
Code: #include <stdio.h> #include <stdlib.h> #include<time.h> //para gerar numeros aleatorios int main() { int i; int quant_random; //Quantidade de aleatórios gerados…
-
1
votes4
answers744
viewsA: How to get the highest and lowest number among 15 typed numbers? C++
One way I consider very good is to use vector and the algorithm, they already have a function to see the lowest value and the highest, so it will not be necessary to use any if. Code: #include…
-
2
votes2
answers55
viewsA: How to catch the smallest hints from the list, but only from Dice 0 to 1
One of the ways to do this is to @Williamteixeira said, it would be you slice the sequencia. Some ways you can do this: min(z[0:2]) min(z[:2]) min(z[-5:2]) #isso só ira funcionar se a lista tiver 5…
-
1
votes2
answers25
viewsA: Error in C++:Undefined Symbol: Rec::n
You need to initialize the variable n, but that code: static int n=0; will not work, you need to declare it externally. First, in case you don’t know, what is a static variable? A static variable is…
c++answered Codigo de Senior 562 -
3
votes2
answers124
viewsA: Doubt in array method each_with_index
He’s doing it because you’re telling him to do it. Like the * is among "" he considers a string and not a mathematical operation. One way to solve this is to put everything into one #{}, this is…
-
2
votes1
answer73
viewsA: Why is the result of this operation resulting in an integer and not a "float"?
Even if you define the y as float, the division numbers are whole, soon the compiler C++ assumes that the result will also be integer. As @Leafar said, for him to perform the division decimal, you…
canswered Codigo de Senior 562 -
3
votes3
answers195
viewsA: List without negative number
Another way to achieve this is to add a check to if: ...and valor >= 0: So it would prevent a value less than 0 entered. Code: numero = [[], []] valor = 1 while valor >= 0: valor =…
-
1
votes2
answers69
viewsA: I can’t debug imported module in project in Visual Studio Community 2019
For you to get debuggar your code, open the launch.json to create the file, right-click on an executable file in the Solution Explorer and choice Debug and Launch Settings, choose the option that…
-
2
votes1
answer19
viewsA: Error with window creation using Tkinter
The error occurs for two causes. Are you calling the mainloop at first, preventing the code from executing the rest, so it does not change the title nor the size To function geometry() receives as…
-
0
votes2
answers107
viewsA: Imports in Python 3
According to official documentation, when you want import some local file, just put: import nomeDoArquivo, but when it is in a different folder than the local, the python uses the . envés da / or .…
-
1
votes1
answer83
viewsA: I tried to make my program in C open already in full screen, but it appeared 'error: expected declaration specifiers or '...' before Numeric Constant'
The code you are using should be in a int main(), but it is not recommended to use this, because you are manipulating the keyboard(this code simulates that you are pressing keyboard keys), so if you…
-
0
votes2
answers64
viewsA: How to insert Rand into C?
There are several ways you generate numbers randomized in the C. First add libs to your code: #include <stdlib.h> #include<time.h> Then at the beginning of the code add this line:…
-
0
votes1
answer91
viewsA: I set the WPS Hide login wrong. How to resolve?
As you are on your local server there are two ways to solve this. The first and easiest is to access with /wp-admin use /login Or case of wrong with the /login, how are you in the localhost to just…
wordpressanswered Codigo de Senior 562 -
0
votes1
answer71
viewsA: Where to use the n in the printf?
The \n means line break, when you put it in your string means you want to skip a line, because for the compilador if you skip several lines or no line for it is the same thing, with \n you can tell…
-
0
votes3
answers171
viewsA: Why does it return "Undefined" because it has an "if/Else"?
This happens because when you run a function with console.log(myFunction()) he expects some return of its function. Your if occurs correctly, and executes your console.log(), but you perform the…
-
0
votes3
answers635
viewsA: Local Push Notification iOS
There is a separate version for iOS To be able to use it according to the official documentation You need to use this pacote: yarn add @react-native-community/push-notification-ios So, envés de…
-
0
votes2
answers341
viewsA: Problem with pandas in pycharm
The python is a language POO, soon he has a concept called polimorfismo, this makes it in case I have a function something(self) I may have the same function something(self) with a parameter amais,…
-
0
votes1
answer22
viewsA: How to enter a discount value based on a year variation? Example: >2010=7% and <2010=12%
The problem is you’re saying you want to print one inteiro(in fact the %i is to inform that the base can be either 8, as 10 or 16) and is passing a string. printf ("%i", "\nO desconto sera 7%"); To…
canswered Codigo de Senior 562 -
0
votes1
answer670
viewsA: Error : Too few Arguments to Function 'Fdelta'
Watching your code, realized that you declared the function Fdelta() receiving 3 parameters inteiros, and when you will use you are not passing the parameters, this error refers to missing…
canswered Codigo de Senior 562 -
1
votes2
answers297
viewsA: Python calculator does not return function
Exchange the input() for int(input()), for only the input(), returns a value like string, the int() will specify that the entree is whole, the code would look like this: def calculadora():…
-
0
votes1
answer19
viewsA: Javascript handling through a button multiple snippets of Html text
This happens because in html the id is to give a indentifier for only 1 element, to select several of them, one of the ways is to use the atribitus class. The code would look like this: <head>…
-
0
votes1
answer314
viewsQ: Error to compile Opengl code
Good Afternoon, I use linux and I’m learning OpenGL, but when I go compile my code for that mistake: /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':…
-
0
votes1
answer37
viewsQ: Error with class destructor
Good morning, I am trying to develop a matrix math engine, the error that is giving in my code is this: R4DVector3n.cpp:(.text+0x226): undefined reference to `R4DEngine::R4DMatrix3n::~R4DMatrix3n()'…
c++asked Codigo de Senior 562