Posts by Gabriel Gomes Nicolim • 122 points
7 posts
-
0
votes1
answer23
viewsA: Problem with spaces and structs in C
Your error is in your repeat loops. The entire vector in C starts at position 0 and goes up to the value set as your tamanho - 1. When iterating over the positions of the vector and fetching its…
-
2
votes2
answers49
viewsA: SQL - WHERE using 2 conditions and AND as conditional - Answer is not the expected result
The function of logical operators is to relate logical propositions. The main logical operators are: AND Será verdade se e somente se as duas expressões relacionais forem verdadeiras OR Será verdade…
-
-4
votes1
answer144
viewsQ: Is the conditional structure "if Else" more performative than a "switch case"?
There are major differences in performance between the conditional structure if else and the switch case within a program?
-
3
votes1
answer75
viewsA: What is the difference between "/" and "%" in python?
Python has some arithmetic operators, these are: + Adição - Subtração * Multiplicação / Divisão // Divisão Inteira % Módulo ** Exponenciação Each operator has its function and must be used to…
pythonanswered Gabriel Gomes Nicolim 122 -
-1
votes3
answers157
viewsA: How to add digits from a number to "1" digit?
To solve this problem we can use the following program def sum (n): # Realiza a soma s = 0 for i in n: # Percorre toda a string s += int(i) # Converte cada posição para um tipo inteiro e soma return…
-
-3
votes1
answer71
viewsA: problem with Try and except in a simple python program
To get the desired result we can use a specific error handling for each input as follows: def questao3(): try: nome_produto = input('Digite o nome do produto: ') while True: preco =…
pythonanswered Gabriel Gomes Nicolim 122 -
2
votes2
answers214
viewsA: Set dynamic height for div with javascript
The child element, in this case . master, has its width related to the parent element, in this case the body. We can therefore set the body width attribute to 100vw (Full screen width) to make it…