One Liners

Explore the thrill of “single-linedly” solving problems.

It’s always fun to code out simple problems in all the crazy ways possible. It also helps us learn about various functionalities and techniques related to a programming language.
As a learning programmer, one of our personal favourite tasks is writing up one-liners for each problem we stumble upon. Writing a complicated, single line of code to solve problems may seem futile since it has poor readability, but it isn’t. One line solutions compel the coder to use the programming language to its fullest to get the job done compactly.
Apart from that, writing one-liners is also a fun challenge. Treat them like 9th-grade Mathematics textbook problems where you don’t care why the man bought those 60 watermelons.
So, are you up to these challenges?


Symmetric matrices

Check whether a matrix is symmetric or not using Python.

Remove duplicate elements from lists

A neat and compact way to remove duplicate elements from lists.

Enter, semiprime numbers

We all know about primes, let’s now dig into semiprimes.

Behold, the factorial

A neat and shorthand way of expressing the factorial in Python.