Putting a simple if-then-else statement on one line

How do I write an if-then-else statement in Python so that it fits on one line?

For example, I want a one line version of:

if count == N:
    count = 0
else:
    count = N + 1

In Objective-C, I would write this as:

count = count == N ? 0 : count + 1;

← Назад к списку