Most voted "function" questions
The function (also called procedure, method, subprogram, or routine) is a portion of code intended to perform a single, specific task.
Learn more…1,309 questions
Sort by count of
-
-1
votes1
answer39
viewsHow to solve the c variable problem - string capacity, start to grow exponentially from the 3rd cycle
I’m having a problem, here with a program that aims to be a data entry routine, the problem in question, is the variable c that goes to the Cap function to ask the user the maximum capacity of the…
-
-1
votes1
answer44
viewsHow to create a new column 'ANO_NASCIMENTO' and insert data into it in sequence, considering each row of the column NAME
Hello!! I’m a beginner in Python and I would like to count on your help for the problems below. I have a df with 2 columns. NOME N.CELULAR João Pedro 98 – 9112 1632 Luís Antônio 98 – 8513 4545…
-
-1
votes1
answer71
viewsAssign value from a JS variable to an HTML element?
Next, I assigned a value to a button, and passed to my function through the onClick. Only now, I’d like to take that amount that’s in index and input my modal... How can I do this? My button that…
-
-1
votes1
answer49
viewsHow to access, within a function, the member of a dynamically allocated structure?
I have the following code in C: #include <stdio.h> #include <stdlib.h> struct pessoa{ char nome[11]; int idade; } void cadastra_pessoa(char novo_nome[11], int nova_idade, struct pessoa…
-
-1
votes1
answer24
viewsHow to pass string to struct within the function
Hi, I have to do a CRUD in C, but I have a problem, I have to pass 3 strings to a function but I have no idea how to do, I’ve tried everything... #include <stdio.h> #include <stdlib.h>…
-
-1
votes1
answer18
viewsProblem with update Trigger PLPGSQL
I have a Trigger for a stock audit, the Insert of it works, but the update no, or it changes nothing or changes all records with the same item code. How can I adjust this part of the Where of update…
postgresql function sql-update trigger plpgsqlasked 3 years, 6 months ago Camila Gabrielly Gonçalves 1 -
-1
votes2
answers73
viewsThe code below is not running. Only when I remove the variables Width and Height from within the functions
Is it possible for someone to answer this question? It should be simple, but it’s breaking my head. The code below is not running. Only when I remove the variables Width and Height from within the…
-
-1
votes2
answers67
viewsDoes every function need a Return at the end of its execution?
Good morning everyone, I’m starting my studies in python and during the programming of a function that goes in the spreadsheet and transfers the values to a dictionary I came up with a question: All…
-
-1
votes1
answer24
viewsTake a variable from within a function
How can I get a variable from inside a function. my code: function buscaGeralPessoas($buscaPessoas){ $result_msg_contatos2 = "Select idGeralPessoas, cpf, nome, telefone1, telefone2, celular, email…
-
-1
votes0
answers23
viewshow to change the color of a text via a conditional with Javascript
Good guys, good guys! I am creating an app that counts the score of a volleyball game, but I would like to give an increment by changing the colors of the score to green for those in front, yellow…
-
-1
votes0
answers18
viewsI can’t make a sum
Hello, I am developing an application that makes a calculation of electricity consumption in React Native. In it, I have 2 pickers: one of hours and the other of minutes. And to make it easier on…
-
-1
votes1
answer18
viewsAssemble an Array of at most 10 x 10, which the user chooses the order in a function, and then assemble the matrix in another function
Write a program that reads an array (maximum 10 x 10). The order matrix is chosen by the user. Next use a function to: a) Read integer values from matrix; b) Show matrix values; However, it is…
-
-2
votes1
answer43
viewsFunction that makes the direct $foo[array_rand($foo)]
There is a native PHP function that does this without using array_rand in the array key? Although it is working well and is a simple stretch, it follows a simplified example of doubt: //Declarando…
-
-2
votes1
answer927
viewsMake a function that receives a matrix A(10,10) and returns a vector with the sum of each of the lines of A
I’m trying to solve this problem. #include <stdio.h> /* 5. Faça uma função que receba uma matriz A(10,10) e retorna um vetor com a soma de cada uma das linhas de A. */ int matriz[3][3]; void…
-
-2
votes1
answer59
viewsI can’t run Def in Python
How do I execute a def and a return in Python? I always do it in edit mode and when I run everything is blank, nothing comes out,?
-
-2
votes2
answers328
viewsWith "echo" it works and with "Return" it doesn’t
I have a function, and it checks if the ID that I’ve informed has more than six records in the database. If it has, then it takes, makes a select to return these 6 records and plays in an array and…
-
-2
votes1
answer74
viewsMethod to return string from an integer value
I have a function meses_dias that receives an argument, a whole number of days, and returns a string that says how many weeks and days that number represents. For example, meses_dias(10) must return…
-
-2
votes1
answer186
viewsWhat is a specific C function for?
What is a C function for, its usefulness?
-
-2
votes2
answers159
viewsProblem calling javascript function
I am making a web application with javascript, my js file has several CRUD functions, I wanted when HTML was loaded, call two functions, so I added this code: document.addEventListener('load',…
-
-2
votes3
answers1379
viewsHow to traverse an element by one in a JS array
Come on, guys, good afternoon. I’m doing a function that has the same utility as ANY. What is the idea, is to know if it has any number smaller than the given in the function inside the array,…
-
-2
votes2
answers170
viewsMaking Javascript function accounts
Hello, I have to multiply using the function, are 3 calculations. When I do the following structure, only the last result appears in Return. function multiplicar(){ return (7*5), (7*10), (50*0.5); }…
-
-2
votes1
answer93
viewsI can’t access the function
I’m trying to access the function getTitleIdLocation() in order to display the values I gave to the three variables, but I cannot. I cannot call the array in this way? Code: <?php class Imovel {…
-
-2
votes2
answers110
viewsUsing the for command in Javascript
People, can you help me ? I am trying to get a function to be executed and to return the word "Blue" 4 times, through a Cycle. I tried to write this here, but it gave the following error…
-
-2
votes2
answers144
viewsCreate an object that contains four words. Use the sample function to sample 1000 values of that object
...continue-Find out how to use the table function to know how many times each word was drawn. I created the four words that are "hi" "hi" "hey" and "hi" but when I tried according to an example I…
-
-2
votes1
answer88
viewsWhy does a variable passed to function not keep the changed value when it exits the function?
I want the variables latitude and longitude to be updated, but only the variables lon and lat are being changed. I cannot add latitude = latitude - 1 or longitude= longitude + 1.…
-
-2
votes1
answer204
viewsFunction for monthly media calculation
I want to calculate the temperature average of each month of the year using a function. It’s not working. Follow the code I tried import pandas as pd tabela =…
-
-2
votes1
answer173
viewsShow Div and hide others that are visible with 2 arrays in Javascript
I have the following code based on JavaScript: var perguntas = new Array(); var respostas = new Array(); var totalPerguntas = 2; perguntas[1] = "Pergunta um"; respostas[1] = "Resposta um";…
-
-2
votes1
answer39
viewsHow can I use more than one function in the same Thread?(python)
I already tried that but it says that the is not defined: import threading as te import time b=[] def c(): global a a=0 while b==[]: time.sleep(0.001) a+=0.001 def i(): b.append(input('enter'))…
-
-2
votes1
answer42
viewsCreate a function that reads a list correctly
This function should ask for a name to be used as a search term. If the search movie is in the list, all data from the movie. Otherwise, a message that is not on the list. This is the function I…
-
-2
votes2
answers137
viewsFunction returning another function
How the second function is returning the function f? And where the function is being returned to f since, when I give print in the variable, the value returned is 'hi' and 'None'? def f(var):…
-
-2
votes2
answers39
viewsFunction error when used on another page
I have the following code class Auth { function getMemberByUsername($username) { $db_handle = new DBController(); $query = "Select * from members where member_name = ?"; $result =…
-
-2
votes1
answer47
viewsDifference between Function and Function
I started studying Js recently and I am in doubt between the use of function and Function.
-
-2
votes1
answer20
viewsHow to query running applications in windows through python?
my application is to create a program in python that identifies the software x or y is open on the operating system, or that returns me a list of software running on the operating system. I tried…
functionasked 3 years, 5 months ago marcusvtsilva 1 -
-2
votes1
answer40
viewsI need to print a L1 line of a matrix in C
After reading L1 in main, I need to pass line A[L1] to a function and print this line Prints(A[L1]), only it gives an error saying that it does not recognize the parameter. What can it be? void…
-
-2
votes1
answer56
viewsPerform function according to dictionary key
I want the user to choose an option and according to the chosen option the system performs a specific function. I wanted a more generic solution without a lot of if, elif and else. I thought of…
-
-2
votes1
answer74
viewsFunction created to perform other functions
I’m doing a project that calculates how much the user spends per month and their profit through the information he typed in the inputs, so he will click on a button and his result will appear inside…
-
-2
votes1
answer40
viewsRecursive binary search, but this error appears:"expected Primary-Expression before 'int'"
#include <stdio.h> #include <stdlib.h> //Funcao para busca binaria com recursividade int BuscaBinariaR(int vetor[10], int inicio,int fim, int x) { int meio = (inicio+fim)/2;…
-
-2
votes1
answer2656
viewsCalculating Javascript false/rue relationship
Could help me solve this question, it should return false/true! We need to create a function that checks if two people are half brothers! In order for you to solve this exercise, we have defined for…
-
-2
votes1
answer38
viewsHow to change the value of a variable that is within a function through another function?
I have seen similar questions here in the OS, but I still can not solve the following situation, where I have the function below that is inside an external script: function updateScript(marcador, a,…
-
-2
votes1
answer147
viewsPython Dictionary - Most Common Word Count
good night. I am studying dictionaries, I have developed the following algorithm for word accounting in articles contained in TXT’s files and display of more frequent words, but I am not able to…
-
-2
votes3
answers308
viewsParameterized functions - calculatValue
I’m taking the first Javascript classes, so my doubts are simple. Enunciation: After our consultation, Digitallaundry realized that could make your collection more sophisticated and fair. She…
-
-2
votes1
answer687
viewsJS/Vue CPF validator
I’m trying to use a function to validate CPF and at the end of it call the function that checks whether the field is required and numerical. If I call only the function forgotmain, all goes well,…
-
-2
votes1
answer35
viewsReturn two functions in a JS onclick event
My question is simple, suppose I have a button, when I once click on it I want to run a function as you can see below: function ativar() { var btn = document.getElementsByTagName("button");…
-
-2
votes1
answer25
viewsError: Undefined Reference to Function
#include <iostream> #include <stdlib.h> #include <windows.h> // textcolor #include <conio.h> using namespace std; bool verifiva_primo(int n); int main(){ setlocale(LC_ALL,…
-
-2
votes1
answer32
viewsWith regard to React
I have a question about react, i wanted to change the content of the page by clicking, but the site recognizes only as Object. Function import React from 'react'; //funções export function botao2(){…
-
-2
votes1
answer91
viewshow to decrease ifs? in python
I’m starting in programming and would like to know if I have how to decrease the uses of ifs """ Classification of a person by height and weight alt = float(input("Digite a sua altura")) p =…
-
-2
votes1
answer244
viewsParallel scripts using Threading - Python
I’m trying to run parallel scripts in Python, using the threading library, but I’m not being able to apply it to my case. I believe the problem is to receive my function, but even creating a list,…
-
-2
votes1
answer122
viewsA function that takes the names of two files as arguments
Program containing a function that takes the names of two files as arguments. The first file contains student names and the second file contains student grades. In the first file, each line…
-
-2
votes1
answer34
viewsArchitecture to complete
I’m creating an RPG to play on the Javascript console. I created a conditional within a function that, if chosen, the whole program for ,but is not happening. Can someone give me an idea of a…
-
-2
votes4
answers142
viewsVariable value changes in main function
When I declare a function and put the parameter to receive a variable of the integer type, for example, within the main function when I declare the function int param(int x); and then I call the…