mardi 4 avril 2017

how do i add a phrase to a float (decimal) number in python?

So I'm working on a code to divide numbers and its dealing with if statements and stuff. What I have currently is:

num= int(input( "Enter the numerator: "))  

den= int(input( "Enter the denominator: "))   

if (den==0):  
    print ("Error - cannot divide by zero")  
else:  
    print ("Decimal: ") + (num/den)  

Well, my issue is on that last line of code. I have no idea what I'm doing wrong, I've tried float, str, and int and every time it gives me an issue.

Aucun commentaire:

Enregistrer un commentaire