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
-1
votes
4 answers

Multiple conditions using python selenium webdriver wait-until

I almost sure that there are few simple solutions for that, but.. i'm clicking an element of web page and one of more than 2 different pages can appear after it. Than i need to click one of the specific elements for each kind of result pages. If i…
-1
votes
1 answer

Best way to test conditions on a dynamic list of items?

First off, sorry if the title is not 100% accurate. I have a problem. I have a dynamic list of items in List A, the number of items can be anywhere between 1-50: item1 item2 item3 I need a function that loops through these items checking if a…
-1
votes
1 answer

Can i print two statements with different conditions in a single if statement in python?

In this code if a person if greater than 80 he/she should be displayed with different statement whereas the one with age greater than 18 different but if possible without adding anymore if statements if 80 > given > 18: print("you are eligible…
-1
votes
1 answer

multiple excel OR conditions

Request help: =IF(AND(OR( S:S="Sales Hub", S:S="Office Integration", S:S="Opportunities", S:S="Export to Excel", S:S="Gamification", S:S="LinkedIn", S:S="Leads")), "Project…
Ram RK
  • 1
-1
votes
3 answers

How to sum values from two columns in R based on conditions from two other columns?

HomeTeam AwayTeam FTHG FTAG FTR HST AST 1 Aston Villa Wigan 0 2 A 5 7 26 Liverpool Aston Villa 1 3 A 12 4 34 Aston Villa Fulham 2 0 H 4 3 45 Birmingham Aston Villa 0 1 A 7 …
-1
votes
1 answer

Is there an R code or function that can help me with if statement with multiple condition

I'm cleaning up my dataset which is a data frame with two columns, obtained after I joined multiple data frames. I'm trying to find a code or a logic way to tell R to create a third column using the following rules: If both columns contain non-NA…
Mr.M
  • 111
  • 1
  • 9
-1
votes
3 answers

Testing multiple string 'in' conditions in list comprehension

I am trying to add multiple 'or' clauses to a python if statement using list comprehension. My code is shown below. I would like to keep the list comprehension. In terms of pseudocode, the logic would simply be: Alive_Beatles = each name that…
Dongs14173
  • 185
  • 4
  • 14
-1
votes
2 answers

Sort user defined objects with multiple constraints in a single stretch using java

I'm having employee objects and i want the sorted list by name in descending order and salary in ascending order. class Employee { String name; Long salary; }
Pandiyan
  • 39
  • 4
-1
votes
2 answers

Multiple conditions inside td's class attribute

I have an object that has a String attribute which may be of four possible values, for each value i want to put a different css class to the cell . I am wondering if there is a way to write composite conditions in here:
Lujain
  • 21
  • 4
-1
votes
4 answers

Is there a way to combine memberwise comparison within an if-statement in python?

I want to check multiple conditions in an if-statement if a: # do something a in this case is true for multiple cases a==1, a==2, a==3 instead of writing if a == 1 or a == 2 or a == 3: # do something I am trying something like this if a…
mrk
  • 8,059
  • 3
  • 56
  • 78
-1
votes
2 answers

SELECT column1 FROM table WHERE column2 is greater than column1

I want to display all values of a column that is greater than its equivalent value in another row Like for example, Display country name WHERE population is greater than country name (i.e. Andorra) SELECT name FROM country WHERE population >…
klms
  • 3
  • 3
-1
votes
1 answer

I need help writing an if then statement using 2 criterion of ltv and credit score

Please help! I've been ripping my hair out trying to figure this out on Excel. I'm trying to write a code that outputs a percentage value based off of LTV and Credit score range. If the LTV is equal to or above 75, and has a credit score >725 then…
-1
votes
1 answer

VBA - multiple conditions for each cell

I'm trying to solve this code's issue, which I can't run: '======================================================================== ' CHECKS IF MARKET SECTOR IS EMPTY (FOR…
Srpic
  • 450
  • 5
  • 13
  • 29
-1
votes
5 answers

Can I use an if statement with multiple conditions? PHP

I bet I can, but would it work like this? function dutchDateNames($) { $day = explode('-', $date)[2]; $dutchday = ($day < 10) ? substr($day, 1) : $day; $month = explode('-', $date)[1]; if ($month == '01' . '02') { …
-1
votes
2 answers

Grouping on two columns and performing multiple calculations

I am currently working with a large dataframe which consists of rougly 20 columns and a lot of rows. Simplified it can look like this: letter = c("A", "A", "A", "B", "B", "B", "C", "C", "C", "C", "A", "A", "A", "B", "B", "B", "C") number =…
Paul
  • 1,801
  • 1
  • 12
  • 18