[Solved] Short-Circuit If Condition Does not work

In your example you can have TWO different causes for the NullReferenceException: – Value `user` is null; – `user.FirstName` is null. I assume you’ve checked already if user is not null, so lets skip that one. Now lets assume that user.FirstName is null, what happens then? The first condition string.IsNullOrWhiteSpace(user.FirstName) will result to true. Is … Read more

[Solved] I’m getting an IndentationError. How do I fix it?

Why does indentation matter? In Python, indentation is used to delimit blocks of code. This is different from many other languages that use curly braces {} to delimit blocks such as Java, Javascript, and C. Because of this, Python users must pay close attention to when and how they indent their code because whitespace matters. … Read more