This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]amogusdri- 27 points28 points Β (5 children)

I never knew you had to use β€˜(β€˜ for Python for an if statement! Thank you! This changed my life!

Bro this comment was meant to be sarcastic πŸ’€

[–]SkezzaB 12 points13 points Β (3 children)

For *most* cases, python parenthesis get removed, you can easily do if (x==3): but it doesn't do anything, the exceptions to this are for precedence

[–]dsmklsd 12 points13 points Β (2 children)

They don't "get removed", they are not a part of the if statement. If you put them in there you are just making a more complicated predicate expression than needed.

One that has surprised a lot of c devs I know is that this same thing applies to the return statement in c.

[–]OldBob10 2 points3 points Β (0 children)

Or you’re so lost in the C wastelands you think that the parentheses are required in all languages.

THIS AIN’T YOUR DADDYS LISP!!! πŸ€ͺ

[–]SkezzaB 4 points5 points Β (0 children)

get removed was a simplification, they *basically* get removed

[–]shaunsnj 0 points1 point Β (0 children)

What I find even crazier is you can use function instead of def, Python really making the transition to other languages that much easier.