Real Python
  • Start Here
  • Learn Python
    Python Tutorials →
    In-depth articles and video courses
    Learning Paths →
    Guided study plans for accelerated learning
    Quizzes & Exercises →
    Check your learning progress
    Browse Topics →
    Focus on a specific area or skill level
    Community Chat →
    Learn with other Pythonistas
    Office Hours →
    Live Q&A calls with Python experts
    Podcast →
    Hear what’s new in the world of Python
    Books →
    Round out your knowledge and learn offline
    Reference →
    Concise definitions for common Python terms
    Code Mentor →Beta
    Personalized code assistance & learning tools
    Unlock All Content →
  • More
    Learner Stories Python Newsletter Python Job Board Meet the Team Become a Tutorial Writer Become a Video Instructor
  • Search
/
  • Join
  • Sign‑In

— FREE Email Series —

🐍 Python Tricks 💌

Python Tricks Dictionary Merge

🔒 No spam. Unsubscribe any time.

Browse Topics Guided Learning Paths
Basics Intermediate Advanced
ai algorithms api best-practices career community databases data-science data-structures data-viz devops django docker editors flask front-end gamedev gui machine-learning news numpy projects python stdlib testing tools web-dev web-scraping

Table of Contents

  • Decimal vs Fractional Notation
    • Classification of Numbers
    • Numeral Systems and Notations
    • Numeric Data Types in Python
  • Creating a Python Fraction From Different Data Types
    • Rational Numbers
    • Floating-Point and Decimal Numbers
    • Strings
  • Inspecting a Python Fraction
  • Converting a Python Fraction to Other Data Types
    • Floating-Point and Integer Numbers
    • Decimal Numbers
    • Strings
  • Performing Rational Number Arithmetic on Fractions
    • Addition
    • Subtraction
    • Multiplication
    • Division
    • Exponentiation
  • Rounding a Python Fraction
  • Comparing Fractions in Python
  • Choosing Between Fraction, Decimal, and Float
    • Binary Floating-Point: float
    • Decimal Floating-Point and Fixed-Point: Decimal
    • Infinite Precision Rational Number: Fraction
  • Studying a Python Fraction in Action
    • Approximating Irrational Numbers
    • Getting a Display’s Aspect Ratio
    • Calculating the Exposure Value of a Photo
    • Solving the Change-Making Problem
    • Producing and Expanding Continued Fractions
  • Conclusion