[Python] How to convert an improper fraction to a mixed number, using python

Discussão em 'Python' iniciado por Stack, Novembro 24, 2025.

  1. Stack

    Stack Membro Participativo

    I have to write a program that converts an improper fraction to a mixed number. Prompt the user for the numerator and the denominator, then calculate and display the equivalent mixed number. numerator is 23 and denominator is 6.

    This is what I have so far...

    num = int(input('Type numerator'))
    dem = int(input('Type denominator'))


    I'm not exactly sure what the next step is...I know the answer is supposed to be The mixed number is 3 and 5/6.

    Continue reading...

Compartilhe esta Página