condição

What are [] in bash for?

I'm starting in shell script now, and often, reading other people's programs, I see the use of [] associated with if. For exa ... hese characters... I wanted to understand exactly how this works and when I should use it in my scripts. Can anyone explain?

How do I use the IF and else functions?

I'm having problems with functions if and else, I started my programming Studies a short time ago and did not quite understan ... Is it something like that? número = 2 If número == 2: Print("esse número é 2") Else: Print("esse número é diferente de 2")

In Python is there ternary operation?

I often see several programming languages where a ternary operation is almost always identical. (x % 2 == 0) ? "par" : "impa ... " ^ SyntaxError: invalid syntax If that doesn't work, then what would a ternary operation look like in Python?

How to paint cell according to the value of a select?

I am in need of a help to format a <td> according to the result of select PHP. I thought about using jQuery but I don't ... put only in jQuery without integration with <?php>, as I would like it to auto update with function $(document).ready.

Two conditions in the same if() javascript loop

I am unable to prevent the submit button from performing its action if the information entered is not the same, could anyone ... (); } }; * the script is already linked at the end of the HTML * I tried the forms you sent, but none worked

How to invoke function on first button click and another on second click

How do I get the first function to be called within the first click of the button, by the event ondblclick(); and the second ... ?:, the same as if .. else, only of lowercase formula and appropriate for this idea. Thank you since ja, help from everyone.

Fetch a certain row or specific value of a matrix vector in R

How to construct a function that evaluates whether any row of the array mat is equal to the Vector vec both in the code below ... s in mat? Note: I understand that mat==vec must be equal to TRUE, that is, mat-vec==0 If mat-vec<tol, where tol = 1e-5.

Formatting to change color and Status depending on the Conditional of another cell [closed]

closed . This question needs details or to be clearer and is not currently accepting answers. ... g between 5 to 6 by example, in the condition if I can't get the result. How to solve this problem? Thank you for your help.

How to apply the same condition / operation to each element of a vector in C

Hi, guys! I need to perform the same operation for all elements of a given vector. How to do this? More specifically, I ne ... es(i+1, numero)){ vetor1[i] = vetor[i]; printf("%d ", vetor1[i]); } } return(0); }

IF, ELSE IF, ELSE or IF IF IF. When to use, what's the difference?

Is a very basic question, but it intrigues me a lot. See the code below: var bola = "redonda"; if(bola == "comestivel") ret ... eber(); else chutar(); That is, the same end can be obtained in both ways. Wouldn't And else if have only semantic effect?

How to use the If block with variable types in Python?

I am creating a program in Python and I need the ID field data to necessarily be integers. Basically I want to enter the bloc ... nome = nome_entry.get() id = id_entry.get() tipo = tipo_entry.get() localizacao = localizacao_entry.get()

When to use ternary condition?

I particularly like the use of ternary condition, but I see around a lot of developers saying against it, there is even a rul ... } } Then the question arises, when should we use the ternary? And is it so bad to use nested ternaries with a good id?

Condition to continue loop while value is invalid

Wanted to know about this Code: Algoritmo "Brincadeira2Ou1 " Var A, C, P: inteiro Inicio A <- 0 C < ... ed. It would not be right to be less than or equal to 1 or greater than or equal to 2 than less than 1 or greater what 2 ?

How to deal with various conditionals (if and else if in a row) in Java and how to compress them?

I currently have a small group of classes that implement a two-player snake game. I am implementing the movements as the key ... write that part of the code more efficiently. How could I improve the reading and understanding of the KeyPressed() method?

What is a guard clause?

What is a guard clause ? Possible translations and synonyms: Save clause guard condition Sentinel clause Preventi ... ction Clause More complete definition . What are your advantages? Does the code become more readable with them(as a rule)?

Function that returns if one we can go to the bank with true / false? [closed]

closed. this question is out of scope and is not currently accepting answers. ... s FALSE even if the date being Friday and the schedule being 10. Would anyone know how to explain what is causing this error?

What is the difference between else and elseif?

Wanted to know what the difference between else and elseif in PHP, and when should I use one or the other.

How to apply the IF ELSE condition to the selection of a column?

In MySQL, I have an old table entities where the column gender is in the format ENUM, containing values of Type: "i", "m", " ... n I apply a condition IF ELSE to the selection of this column, indicating the desired value for each of the existing options?

In PHP the correct is else if or elseif?

In PHP, is the correct one else if or elseif? What is the difference between them? The language allows you to write everything together and separately, and apparently the results are identical