Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multiple conditions
#3
(Jan-30-2020, 03:42 AM)metulburr Wrote: python code reads a lot like speech, so your requirement is not far off from the actual source code
if name in ("spiderman","antman") and salary in range(1000,2000) and city not in ("boston","dubai"):
    new_column=age+salary
else:
    new_column=age*salary 
For the if condition to pass all 3 of those conditions have to return True.

Hi There,
I tried to do it as per your instruction, but it failed.
It would be great if you can provide me the complete code. I am pretty much new to python.

Thanks,
CK

Hi There,
I tried to do it as per your instruction, but it failed.
It would be great if you can provide me the complete code. I am pretty much new to python.

Thanks,
CK
Reply


Messages In This Thread
multiple conditions - by Chandan - Jan-30-2020, 12:55 AM
RE: multiple conditions - by metulburr - Jan-30-2020, 03:42 AM
RE: multiple conditions - by Chandan - Jan-30-2020, 10:31 AM
RE: multiple conditions - by metulburr - Jan-30-2020, 12:14 PM
RE: multiple conditions - by Chandan - Jan-30-2020, 12:48 PM
RE: multiple conditions - by metulburr - Jan-30-2020, 01:07 PM
RE: multiple conditions - by snippsat - Jan-30-2020, 01:32 PM
RE: multiple conditions - by Chandan - Jan-31-2020, 12:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do you format Update statement with multiple conditions hammer 4 2,159 Dec-16-2021, 10:49 PM
Last Post: hammer
  Multiple conditions when indexing an array with or without np.where noob2305 1 2,703 Oct-25-2020, 02:06 PM
Last Post: jefsummers
  Multiple conditions, one is null moralear27 1 2,225 Sep-13-2020, 06:11 AM
Last Post: scidam
  Help with multiple conditions on ATM program jakegold98 6 9,252 Dec-06-2017, 05:18 PM
Last Post: jakegold98
  Simplifying multiple "or" conditions in if statement. rhubarbpieguy 8 102,283 Jul-22-2017, 12:19 PM
Last Post: rhubarbpieguy

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020