Yong Xie
Yong Xie

Reputation: 1

Python Invalid Syntax with my “if not in and statement”

I use the code as follows:

However, I got the following error:

File “”, line 5 if student not in unique_engagement_students and enrollment[‘join_date’] != enrollment[‘cancel_date’]: ^ SyntaxError: invalid syntax

Upvotes: 0

Views: 434

Answers (1)

Tim Pietzcker
Tim Pietzcker

Reputation: 336248

!= must be written as a unit - ! = is a SyntaxError.

Upvotes: 2

Related Questions