Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python long integer input

How can one take a "long int" input in Python 2.7?

P.S. I tried various variations of n=(*(raw_input())) but to no avail.

like image 717
Vishal Anand Avatar asked Jan 11 '14 07:01

Vishal Anand


1 Answers

n = int(raw_input())

This will convert the input to an integer. Since Python employs arbitrary precision arithmetic, we don't have to worry about how big the number is.

>>> n = int(raw_input())
100000000000000
>>> n
100000000000000L
like image 77
thefourtheye Avatar answered Oct 04 '22 00:10

thefourtheye