Example & Tutorial understanding programming in easy ways.

How the ternary operator works in Python ?

program:

x=10

y=20

smaller = x if x < y else y

print(smaller)

output:

10


Read More →