Przykład zeznania, kontynuuj i przekazuj oświadczenia w Pythonie

def main():
    check = input("Are you a new student(yes/no): ")
    if check == "yes":
        pass
    elif check == "no":
        totalMarks = 0
        numOfSub = 0
        while True:
            marks = input( 'Marks for subject ' + str(numOfSub +1) + ": ")
            if marks == '':
                break
            marks = float(marks)
            if marks < 0 or marks >100:
                print("Invalid marks")
                continue
            numOfSub = numOfSub+1
            totalMarks = totalMarks + marks
        percentage = totalMarks/numOfSub
        print("Total marks: ", totalMarks)
        print("Number of Subject is: ", numOfSub)
        print("Percentage: ", round(percentage,2))
    else:
        print("enter a valid response")
main()
Outrageous Ostrich