I have a variable equal to a input. I want to make the input
function (when user presses Enter) to count it as 0
.
This is my code:
n1 = input('Εισάγετε Λεφτά :')
n2 = input('Εισάγετε Πλυσίματα Μέσα - Έξω :')
n3 = input('Εισάγετε Πλυσίματα Μηχανών :')
n4 = input('Εισάγετε Πλυσίματα Εξωτερικά :')
n5 = input('Εισάγετε Τι Ποσό Πήρε ο Σπύρος :')
n6 = input('Εισάγετε Έλλειμμα :')
n7 = input('Εισαγετε Πρόσθετο Ποσό :')
n8 = input('Εισάγετε Ψιλά :')
answer = (str(float(n1) + float(n5) - int(n2) * 10 - int(n3) * 8 - int(n4) * 7 + float(n6) - float(n7) - float(n8)))
print (float(answer))
input('Press Enter To Exit')
Currently, when I just press Enter on any of the inputs, it returns the ValueError
because it needs a float.