Posts by MSSantana • 326 points
20 posts
-
1
votes0
answers120
viewsQ: Reading csv file with Kotlin
I am beginner in Kotlin and have the following class to read a csv file: @Service class ClienteImportService { fun obtemTodosMsisdn(args: Array<File>) { val reader =…
-
-1
votes1
answer67
viewsQ: Display average wage by years of service
I have the FUNCIO table that has as columns matricula, name, anoServico, salary. I would like to display the average wage per yearService. How to do? Thank you!
-
1
votes2
answers178
viewsQ: Format output in txt file
I have the following code: def verificaPrimo(num): if int(num) < 2: return False else: for n in range(2, int(num)): if int(num) % int(n) == 0: return False return True def…
-
0
votes2
answers306
viewsQ: Print only palindromic words
Training python, I was able to make a program that checks if the input is a palyndrome word. Follow: def palindromo(texto): if len(texto) <= 1: return True else: return texto[0] ==…
-
0
votes1
answer48
viewsQ: Select in Json data
With this select example, I get the Account information I have inside my json: select data::json#>>'{account}' as codigo, assinatura from assinante ce where assinatura in ('XXX') I can get the…
-
-1
votes1
answer28
viewsQ: Display only after typing negative number
How can I display the conversion results only after the negative number is typed? Currently, it reads and already displays. I wish he could read and only after typing a negative number, he would…
-
-2
votes1
answer117
viewsQ: Display Qtd of read numbers, medium, larger and lower read value
I have the following code: qtdNumeros = int(input()) if qtdNumeros <= 0: menor = "Nenhum" media = "Nenhuma" maior = "Nenhum" else: menor = maior = soma = float(input()) for proximo in range(1,…
-
1
votes2
answers116
viewsQ: Show smaller, average and larger until an empty line is typed
I have the following code: qtdNumeros = int(input()) if qtdNumeros <= 0: menor = "Nenhum" media = "Nenhuma" maior = "Nenhum" else: menor = maior = soma = float(input()) for proximo in range(1,…
-
0
votes1
answer390
viewsQ: Display number that most repeated and its quantity
I have the following code: def repetido(numeros, count): for i in range(len(numeros)): count.append(float(numeros[i])) for x in range(len(count)): aux = count.count(count[x]) if aux > count:…
-
1
votes3
answers74
viewsQ: Displaying message of no number read and accepting different types of input
I have the following code: def maior(colecao): if len(colecao) > 1: r = maior(colecao[1:]) if r[0] < colecao[0]: r[0] = colecao[0] elif len(colecao) == 1: r = [colecao[0]] else: r = [None]…
-
2
votes2
answers2065
viewsQ: Display the sum of each row of a randomly generated matrix
I have the following program that generates a random matrix according to the number of rows and columns desired. In it is also located and displayed the highest value of the elements, and their…
-
0
votes1
answer478
viewsQ: Adding and sorting row of matrices in python
The program below generates a random matrix, according to the amount of lines desired. def gerar(nLins, nCols, min, max): from random import randint vals = [None] * nLins for i in range(nLins):…
-
0
votes1
answer2830
viewsQ: Converting Bases to Python
The code below takes a decimal number and converts to bases from 2 to 9 def converte(numDecimal, base): if numDecimal != 0: numConvertido = "" while numDecimal > 0: resto = numDecimal % base…
-
1
votes1
answer59
viewsQ: How to make an if comparing values with a list that is in an yml?
I get a request and want to check if that channel is in a list I created in yml. @ConfigurationProperties(prefix = "parceiros") @Component public class CanaisMapper { private List<String>…
-
3
votes1
answer145
viewsQ: How to make an if by comparing a value with a list in an yml?
I get a request and want to check if that channel is in a list I created in yml. My method: private void insereNome (String canal, ListaNomeWebRequest listaNomeWebRequest){…
-
0
votes1
answer31
viewsQ: Passing map to method
I am a beginner in Java and I have done some little projects as tests. In this case, I’ve been reading and found interesting the map, but, I was upset when it came to applying. I thought it would be…
-
8
votes2
answers2073
viewsQ: Find the largest and smallest element of a matrix
I have the following code: def processa(matriz): print('----- Matriz Lida -----') for i in range(len(matriz)): for j in range(len(matriz[0])): print(matriz[i][j].center(6), end=' ') print() return…
-
0
votes0
answers28
viewsQ: Type matrix and display smaller/larger and their positions
I made the following code that generates the matrix with random values as the dimensions are passed, and brings the result of the lowest value and its position and the highest value and its…
python-3.xasked MSSantana 326 -
0
votes2
answers45
viewsQ: Using variable values
I have this code in GO and as you can see I use two constants to pass the region and the name of Bucket. I would like to know how to leave these values variable, since I can use Buckets in other…
-
2
votes1
answer864
viewsQ: Save Request Spring Boot
I’m a beginner at Spring Boot and I need a little help. I want to save an incoming and outgoing request by generating the automated id and saving the date and time, using Docker and Postgres (I…