Problem Name: Python -
In this HackerRank Functions in PYTHON problem solution,
ntegers in Python can be as big as the bytes in your machine's memory. There is no limit in size as there is: 2**31 - 1 (c++ int) or 2**63 - 1 (C++ long long int).
As we know, the result of a**b grows really fast with increasing b.
Let's do some calculations on very large integers.
Read four numbers, a,b,c and d and print the result of a**b + c**d
Integers a,b,c and d are given on four separate lines, respectively.
1 <= a <= 1000
1 <= b <= 1000
1 <= c <= 1000
1 <= d <= 1000
Print the result of a**b + c**d on one line.
9 29 7 27
Note: This result is bigger than 2**63 - 1 . Hence, it won't fit in the long long int of C++ or a 64-bit integer.
#1 Code Example with Python Programming
Copy The Code & Try With Live Editor
a,b,c,d = [int(input()) for i in range(4)] print(pow(a,b)+pow(c,d))