LearnFrenzy
Sign in Take a free test

Variables and Data Types · Predict the Output · Question 6

A very large integer Answer, explanation & discussion

  • Output
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 6 Back to Exercise

What is the output of the following Python program?

main.py
n = 2 ** 64
print(n, type(n).__name__)
  • A 18446744073709551616 int Correct
  • B 0 int
  • C -1 int
  • D 1.8446744073709552e+19 float
Correct Answer: Option A

Python ints never overflow, so 2 ** 64 is exact and still an int.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links