#sdpsgssolutions #Mixed Fraction #Starter Problems 1 # Open the input and output files. inputFile = open("mixin.txt", "r") outputFile = open("mixout.txt", "w") # Read the input myInput = inputFile.readline().split() n = int(myInput[0]) d = int(myInput[1]) # Calculations numerator = n%d wholenumber = (n-numerator)/d # Write the answer to the output file. if numerator == 0: outputFile.write(str(wholenumber)) else: outputFile.write(str(wholenumber)+' '+str(numerator)+'/'+str(d)) # Finally, close the input/output files. inputFile.close() outputFile.close()