Questions tagged as 'argumento'

5
answers

What is the difference between parameter and argument?

I have always used the terms "parameter" and "argument" as if they were synonyms: what is passed to a function and / or what the function receives as input. In the same way, I have been reading one and another term, in English and Portuguese, so...
asked by 13.09.2014 / 23:40
2
answers

When is a default argument evaluated in Python?

Consider the following class: class Foo: def __init__(self, values = []): self.values = values Note that we are using an instance attribute and not a class attribute, however, see the following code: a = Foo() b = Foo() Two...
asked by 26.09.2017 / 16:49
2
answers

Is it possible to access the same argument twice in sprintf?

In PHP time the function sprintf . With it we can format the values sequentially passed from the second parameter. For example: sprintf('Meu nome é %s e tenho %d anos de idade', 'Wallace', '26') The output will be    My name is...
asked by 08.07.2016 / 18:33
2
answers

Boolean arguments, in general, are not good?

I was reading some of the Clean Code . The book talks about "good programming practices" , and on the internet, one of the slides    Boolean arguments are generally not good. I did not understand the reason for this sentence. Although...
asked by 09.08.2017 / 18:39
1
answer

Run Python file with arguments

In my program, I do the following operation: import sys qtd_ponts = int(sys.argv[1]) I would like to know a practical way to run this .py file by passing arguments without needing an IDE, for example .bat files.     
asked by 24.06.2015 / 12:22
2
answers

What does KWARGS mean in Python?

I know that in Python we can define in a function something like what we call "named parameters", that is, "named parameters". def my_func(**kwargs): pass my_func(nome="Stack Overflow", linguagem="Português") I do not know if my defini...
asked by 24.06.2015 / 13:23
2
answers

How to fix this error "Can not convert from 'int' to 'char []'

Why is this error displayed? I believe the logic is right.     
asked by 07.10.2017 / 23:04
1
answer

How to set a pointer as default parameter in C ++?

I'm "programming in C" but compiling using the .cpp extension and g ++ to have some facilities. My goal is to do a program that receives a starting salary and calculates the final salary according to a certain bonus. The bonus is given in...
asked by 21.08.2018 / 03:15
1
answer

How to pass an array as parameters or arguments?

I have two functions: function example($param1, $param2) { echo $param1 . $param2; } function frutas($fruta1, $fruta2, $fruta3) { echo $fruta1 . $fruta2 . $fruta3; } I also have a variable that gets the parameters of the functions...
asked by 28.05.2016 / 01:17
2
answers

How to create a method with optional parameters in pure Java? [duplicate]

How do I create a method that does not need to enter all the parameters? Ex. There is a method that asks for 5 parameters. But I intend to use only 2.     
asked by 05.08.2016 / 12:49