What is the equivalent of (1LL << X) in python?

where X is any positive integer.

As stated in this answer.

1LL is used when bit-shifting beyond int in C++ and used in competitive programming a lot.

What is the best way to do this operation in Python ?

Is it as simple as doing just 1 << X ?
or something more complicated than that.

>Solution :

It’s just 1 << X, since integers in Python are arbitrary-precision.

Leave a Reply