Creating Function for calculating prices with taxes
<p>So I have a problem, that I have a block of code that works, but it works only when not used with Function.</p>

<p>The full story is, that I have to create a program that asks for the file ( which contains prices without taxes. For example 39, 15, 56, 19, 122, 31, 78 ). Then it asks the user to insert sales tax and then sum that is tax-free. </p>

<p>Code looks like this:</p>

<pre><code> filename = input("Please insert filename: ")
 salestax = int(input("Please insert % of sales tax: ")
 taxfree = int(input("Please insert sum of tax-free: ")

 file = open(filename)
 sum = 0
 for line in file:
     sum += float(line) * (1 + salestax/100)
 file.close()
 sum = round(sum, 2)
 print("Total with taxes " + str(sum))
</code></pre>

<p>But problem is that when I try to make the same block of code with Function, it won't work. It would not be a problem, but one criteria is that there must be used a Function to calculate taxes. </p>

<p>And one more thing. How could I sum up numbers with added sales taxes that are bigger than inserted tax-free? For example, the file contains prices: 6, 17, 79, 200, 54, 36. And inserted tax-free is 35. Then I add sales taxes to them and I need to get back sum with only prices that are bigger than inserted tax-free number.</p>

<p>I used IF statement and >= taxfree, but it still gave me total sum with also smaller numbers or 0 - nothing in between</p>