#pylint:disable=E0001
import time
#(V3)
def tc():
print("This small project will help you to easily calculate total scores of students. \nPlease, write sub summative (SS) 1 score.")
ksq1 = input()
print("SS1 score is " + ksq1)
ksq1 = int(ksq1)
print()
print("Please, write SS2 score.")
ksq2 = input()
print("SS2 score is " + ksq2)
ksq2 = int(ksq2)
print()
print("Please, write SS3 score.")
ksq3 = input()
print("SS3 score is " + ksq3)
ksq3 = int(ksq3)
print()
print("Please, write big summative (BS) score.")
bsq = input()
print("BS score is " + bsq)
bsq = int(bsq)
return (ksq1, ksq2, ksq3, bsq)
def redoCal():
ksq1, ksq2, ksq3, bsq = tc()
print("\nCalculating...")
print()
time.sleep(1.2)
sumKSQ = (ksq1 + ksq2 + ksq3) / 3
sumKSQ = str(sumKSQ)
print("First, we find numerical average of small summative scores. They are added first and then divided by three. \nNumerical average is " + sumKSQ + ".")
sumKSQ = float(sumKSQ)
time.sleep(0.5)
print()
sumKSQ = sumKSQ * 0.4
sumKSQ = str(sumKSQ)
print("Then, we find 40% of numerical average. \nIt is " + sumKSQ + ".")
sumKSQ = float(sumKSQ)
time.sleep(0.5)
print()
sumBSQ = bsq * 0.6
sumBSQ = str(sumBSQ)
print("Third, we find 60% value of big summative score. \nIt is " + sumBSQ + ".")
sumBSQ = float(sumBSQ)
time.sleep(0.5)
print()
totalScore = (sumKSQ + sumBSQ)
totalScore = str(totalScore)
print("At last, we combine two values by adding. \nTotal score is " + totalScore + ".")
theAnswer = ("1")
while theAnswer == ("1" or "Yes" or "yes"):
tc()
redoCal()
print("Would you like to try again? (Yes = 1, no = 0)")
theAnswer = input()
So, first function (which is tc()) is executed which asks the user for 4 inputs: ksq1, ksq2, ksq3, bsq. At the end of the function I return these variables, because I need their value in the next function (redoCal()). To retrieve the values from the previously mentioned variables, I used ksq1, ksq2, ksq3, bsq = tc() in the next function.
When I execute the program, it asks for 4 inputs as expected. However, when I enter 4 inputs, it asks me again to input 4 values. This is where it gets weird, after inputting 4 values again, the code works as intended and it calculates the score I want. How can I make the first function not repeat itself?