PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Python · Theory

Python Numbers

← All stacks

Theory

15/268

Python Numbers

Numbers in Python are int, float, and complex. int has no fixed 32-bit cap — 10**20 is still an int. float is decimal, but binary floating point is approximate: 0.1 + 0.2 is not exactly 0.3. complex uses a+bj for science work; freshers rarely need it on day one.

Cast with int("5"), float(3). int("Asha") raises ValueError. Interview: int is unlimited precision; float has precision limits. Don’t claim float is “exact money” — use Decimal later if they push.

Python Numbers — output — 32, 3.5, 3. Power, true divide, floor divide.

Exam tip

int vs float with one precision caveat.

Example

# Numbers
print(2 ** 5)
print(7 / 2)
print(7 // 2)

Python Numbers — output: 32, 3.5, 3. Power, true divide, floor divide.

Short notes

  • Defint / float / complex.
  • Ruleint can be huge.
  • Trap0.1 + 0.2 exact float.

Questions

1

Explain Numbers as if you are teaching a junior — definition, then one tiny script.

2

What does the example print, and why?

3

What mistake do freshers make with Numbers?

Previous← Data Types in PythonNextType Casting in Python →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.