Python Forum
if and condition not working for string
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if and condition not working for string
#1
I have three list

out5 = ['increasing', 3, 5,3]

out50 = ['increasing', 9, 5,3]

out95 = ['increasing', 8, 7,3]
I am trying to create this condition

if out5[0]=='increasing' & out50[0] == 'increasing' & out95[0] == 'increasing':
       das = 2
but I get error
Error:
Traceback (most recent call last): File "/Users/mada0007/PycharmProjects/Research_ass/station_data_analysis.py", line 240, in <module> if out5[0] == 'increasing' & out50[0] == 'increasing' & out95[0] == 'increasing': TypeError: unsupported operand type(s) for &: 'str' and 'str'
How can I please overcome this?
Reply


Messages In This Thread
if and condition not working for string - by Staph - Jul-01-2019, 06:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Last caracter of a string truncated issue when working from the end of the string Teknohead23 3 1,682 Oct-03-2021, 01:08 PM
Last Post: snippsat
  else condition not called when if condition is false Sandz1286 10 6,093 Jun-05-2020, 05:01 PM
Last Post: ebolisa
  [HELP] Nested conditional? double condition followed by another condition. penahuse 25 8,458 Jun-01-2020, 06:00 PM
Last Post: penahuse
  Differential equations with initial condition in Python (change a working code) Euler2 1 1,898 May-29-2020, 04:06 PM
Last Post: Euler2
  Converting query string as a condition for filter data. shah_entrance 1 1,855 Jan-14-2020, 09:22 AM
Last Post: perfringo
  F-String not working when in IDLE editor nadimsarrouh 5 6,052 Jan-29-2019, 10:02 AM
Last Post: nadimsarrouh

Forum Jump:

User Panel Messages

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