Questions tagged [multiple-conditions]

Examples include if, for, while and other loops.

while (a==1 && b==2)
{
   ...
}

The loop will continue as long as a is 1 and b is 2.

630 questions
-2
votes
1 answer

How to check several conditions at the same time in python?

The actual question is : I want to check the state of charge of several batteries at the same time and perform actions(charge/discharge/amount of charge/discharge) in parallel, based on the values obtained.
-2
votes
4 answers

How to Insert multiple conditions in while loop in

I want to use multiple conditions in while loop: Console.WriteLine("Select an action to perform\n"); int n1 = Convert.ToInt32(Console.ReadLine()); do { Console.WriteLine("Insert a valid method\n"); n1 =…
lasith92
  • 17
  • 6
-2
votes
3 answers

What can I do to make code be executed while the answer is one of a multiple conditions?

I tried to make that a code runs when x, determinated by a prompt is one of the four answers. With only one possibility it works well, but when I add more using && the program do nothing. (At the end of the program i put a break to execute the code…
mrs
  • 5
  • 2
-2
votes
1 answer

Nested if or code multiple times?

As I couldn't find a question similar to my construct, I am going to ask it. I have following code: for (Object o : array1) { for (Object o2 : array2) { if (condition1) { //get a variable for condition2 (depends on iteration…
XtremeBaumer
  • 6,275
  • 3
  • 19
  • 65
-2
votes
2 answers

Which condition satisfies among multiple conditions in SQL query

This is my SQL query : select * from table1 where Column1 less than Condition1 || Column2 less than Condition2 || Column3 Less than Condition3 Now I am trying to find which condition out of above 3 conditions satisfies for a…
Syed Shams
  • 3
  • 1
  • 6
-2
votes
1 answer

Difficult XPath with more conditions

PHONE 717 New PHONE 1 FRIENDLY_NAME TRUE DOWNLOAD
Michal
  • 21
  • 5
-3
votes
3 answers

Multiple conditions for string variable

I am trying to add a new column "profile_type" to a dataframe "df_new" which contains the string "Decision Maker" if the "job_title" has any one of the following words: (Head or VP or COO or CEO or CMO or CLO or Chief or Partner or Founder or Owner…
Alisha A
  • 1
  • 2
-3
votes
1 answer

VBA code for Excel to delete duplicate rows that have certain text

hope you're all doing great. I have a task that has been killing myself and I'd love some help. I have an Excel table that goes from A1:AC13528, but there are a lot of duplicate values. I need to delete the duplicates based on column A, that DO NOT…
-3
votes
2 answers

multiple conditions in for loop - C

I need to execute two conditions for i and j simultaneously. condition for i: for(i=1*counter; i<= len*7*counter; i++) condition for j: for(j=len*7*counter; j>=1*counter; j--) And then, when both these conditions are true, i need to execute…
newbee
  • 409
  • 2
  • 12
  • 34
-4
votes
2 answers

Which conditionals would you prefer

Which way of defining a string would you use? Are there better ways to do this with even more strings? I want to set abbreviations for a large set of predefined strings. If style 1: let stat = str3; if (stat === "str1") { stat = "string1"; }…
-4
votes
3 answers

multiple conditions Under the 'for' loop

Why doesn't the conditional Boolean in the standard for loop below behave as expected? I'm trying to get 3 and 4, indexes 2 and 3 in the array below to print out. If I try to specify the range in the condition of the for loop it doesn't run the…
JohnnyO
  • 527
  • 9
  • 21
-4
votes
1 answer

why multiple condition in python while loop are not working?

I can't seem to find the problem in code... user_decision = "" while not user_decision == "yes" or not user_decision == "no": user_decision = input("You want to Join?: Please answer (yes/no): ") else: if user_decision == "yes": …
alirehman
  • 5
  • 3
-5
votes
2 answers

If statement comparing 2 conditions of ints runs as boolean

My if statement is not working correctly. The purpose is to compare a user given date with the current date, and if both the month and week match (a user's birthday), then getBonus = true. However, my if statement is giving me the following…
-7
votes
1 answer

Python- result of conditions does nothing

so, I started to self-learn Python, but there is small problem with variables and their outcome? choice = input() if (random.randint(0,100) > 20 and choice == (1)): print("Odkopnul jsi krysu a ta sebou") print("prastila o zed az…
-9
votes
4 answers

Why is Java skipping my second condition in the while loop?

Does anyone know why the first condition is being skipped by Java? while((withdraw % 100) != 0 && (withdraw > startBalance)) Although I state that the withdrawal must be less than the startBalance, you can still type a number that is higher than…
1 2 3
41
42