KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to print some stuff only when a boolean variable is set to True . So, after looking at this , I tried with a simple example: >>> a = 100 >>> b = True >>> print a if b File "<stdin>", line 1 print a if b ^ SyntaxError: invalid syntax Same thing if I write print a if b==True . What am I missing here?
Tags (comma-separated)
Save Edits
Cancel